최근게시물 뽑아내는 문제... 정보
최근게시물 뽑아내는 문제...첨부파일
본문
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.
오류 주소 :
게시판 list.skin.php에서는
<?
$parent = $list[$i][wr_parent];
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
//echo $sql;
$row = sql_fetch($sql);
$total_count = $row[cn];
if ($total_count == 0) {
echo "견적신청";
} else {
echo "견적완료";
}
?>
이렇게 뽑아내니까 코멘트가 달리고 안달리고에 따라서 견적신청 or 견적완료가 되는데요...
이걸 최근 게시물로 뽑아내려고
gnuboard4/skin/latest/basic/latest.skin.php를 보면
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
...
이 부분
<? for ($i=0; $i<count($list); $i++) { ?>
<?
$parent = $list[$i][wr_parent];
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
//echo $sql;
$row = sql_fetch($sql);
$total_count = $row[cn];
if ($total_count == 0) {
echo $list[$i]['name'], '고객님 견적신청 되었습니다.';
} else {
echo $list[$i]['name'], '고객님 견적완료 되었습니다.';
}
?>
이렇게 바꿨는데요...
select count(*) as cn from where wr_is_comment = '1' and wr_parent = '38' and mb_id = 'admin'
1064 : 'SQL 구문에 오류가 있습니다.' 에러 같읍니다. ('where wr_is_comment = '1' and wr_parent = '38' and mb_id = 'admin'' 명령어 라인 1)
error file : /index.php
이런 에러메시지가 뜹니다...
뭐가 잘못됐는지 좀 봐주세요~
파일도 첨부했습니다...ㅠ.ㅠ
오류 주소 :
게시판 list.skin.php에서는
<?
$parent = $list[$i][wr_parent];
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
//echo $sql;
$row = sql_fetch($sql);
$total_count = $row[cn];
if ($total_count == 0) {
echo "견적신청";
} else {
echo "견적완료";
}
?>
이렇게 뽑아내니까 코멘트가 달리고 안달리고에 따라서 견적신청 or 견적완료가 되는데요...
이걸 최근 게시물로 뽑아내려고
gnuboard4/skin/latest/basic/latest.skin.php를 보면
<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
...
이 부분
<? for ($i=0; $i<count($list); $i++) { ?>
<?
$parent = $list[$i][wr_parent];
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
//echo $sql;
$row = sql_fetch($sql);
$total_count = $row[cn];
if ($total_count == 0) {
echo $list[$i]['name'], '고객님 견적신청 되었습니다.';
} else {
echo $list[$i]['name'], '고객님 견적완료 되었습니다.';
}
?>
이렇게 바꿨는데요...
select count(*) as cn from where wr_is_comment = '1' and wr_parent = '38' and mb_id = 'admin'
1064 : 'SQL 구문에 오류가 있습니다.' 에러 같읍니다. ('where wr_is_comment = '1' and wr_parent = '38' and mb_id = 'admin'' 명령어 라인 1)
error file : /index.php
이런 에러메시지가 뜹니다...
뭐가 잘못됐는지 좀 봐주세요~
파일도 첨부했습니다...ㅠ.ㅠ
댓글 전체
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
를
$write_table = $g4[write_prefix].$bo_table;
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
를
$write_table = $g4[write_prefix].$bo_table;
$sql = " select count(*) as cn from $write_table where wr_is_comment = '1' and wr_parent = '$parent' and mb_id = 'admin'";
정말 감사합니다~^^