sql 구문이 틀린거 같습니다만...어떻게 바꿔야 할까요? 정보
sql 구문이 틀린거 같습니다만...어떻게 바꿔야 할까요?본문
$cCount = $cCount - 1;
if ($wr_id) {
$sql = " SELECT * FROM g4_board_file WHERE bo_table = '$bo_table' AND wr_id = $wr_id ORDER BY wr_id desc, bf_no asc limit $cCount, 1 ";
} else {
$sql = " SELECT * FROM g4_board_file WHERE bo_table = '$bo_table' Order By wr_id desc, bf_no asc limit $cCount, 1 ";
}
$result = sql_fetch($sql);
$image_ = "{$result[bf_file ]}"; // 이미지파일명저장
$images_ = "$g4[path]/data/file/$bo_table/{$result[bf_file]}"; // 이미지의 경로 저장
$image = str_replace('%', '%25', $image_); // 한글파일명 때문에...
$images = str_replace('%', '%25', $images_ ); // 한글파일명 때문에...
대략 오류가 나는 페이지 sql 구문이 이렇습니다.
에러코드는
select wr_subject from g4_write_ where wr_id =
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
이렇게 나오구요...이미지 슬라이드쇼에 들어가있는 구문인데 어떻게 수정을 봐야할지 도움좀 부탁드립니다.
if ($wr_id) {
$sql = " SELECT * FROM g4_board_file WHERE bo_table = '$bo_table' AND wr_id = $wr_id ORDER BY wr_id desc, bf_no asc limit $cCount, 1 ";
} else {
$sql = " SELECT * FROM g4_board_file WHERE bo_table = '$bo_table' Order By wr_id desc, bf_no asc limit $cCount, 1 ";
}
$result = sql_fetch($sql);
$image_ = "{$result[bf_file ]}"; // 이미지파일명저장
$images_ = "$g4[path]/data/file/$bo_table/{$result[bf_file]}"; // 이미지의 경로 저장
$image = str_replace('%', '%25', $image_); // 한글파일명 때문에...
$images = str_replace('%', '%25', $images_ ); // 한글파일명 때문에...
대략 오류가 나는 페이지 sql 구문이 이렇습니다.
에러코드는
select wr_subject from g4_write_ where wr_id =
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
이렇게 나오구요...이미지 슬라이드쇼에 들어가있는 구문인데 어떻게 수정을 봐야할지 도움좀 부탁드립니다.
댓글 전체

에러가 난 sql문이 위 코드에는 없네요? ^^;
에러만 봐서는, sql을 사용하신 코드에서, 그누보드 기본 common.php나 head.sub.php가 포함되지 않아서 생긴 문제같습니다.
에러만 봐서는, sql을 사용하신 코드에서, 그누보드 기본 common.php나 head.sub.php가 포함되지 않아서 생긴 문제같습니다.