채택완료

sql 퀴리문 코멘트는 빼고는 어떻게 하나요?

새로운 글이 올라오면 뉴 아이콘이 나타나는데 코멘트는 빼고는 어떻게 수정을 해야 하나요 ?

 

Copy
<? // 소메뉴 new 표시$smalls = mw_get_small_menus($mw_mmenus[$i][mm_id]); $smalls_count = count($smalls); for ($j=0; $j<$smalls_count; $j++) {  $new_datetime = date("Y-m-d H:i:s", $g4[server_time] - (60*60)); // 한시간 $new_datetime = date("Y-m-d H:i:s", $g4[server_time] - (60*60*24)); // 24시간 if ($smalls[$j][bo_table]) {    $sql = "select count(wr_id) as cnt from $g4[write_prefix]{$smalls[$j][bo_table]} where wr_is_comment > -1 and ca_name = '{$smalls[$j][ca_name]}' and wr_datetime > '$new_datetime'";    $row = sql_fetch($sql); } if ($row[cnt]) {     $icon_new = "<img src='$g4[path]/bbs/img/comsub//com_new.gif'>"; // new 아이콘 } else {     $icon_new = ""; }// new 끝 ?>
|

답변 2개 / 댓글 2개

채택된 답변
+20 포인트

$sql "select count(wr_id) as cnt from $g4[write_prefix]{$smalls[$j][bo_table]} where wr_is_comment <> '1' and ca_name = '{$smalls[$j][ca_name]}' and wr_datetime > '$new_datetime'";

답변에 대한 댓글 1개

감사합니다~ 그대로 복사해서 넣었더니 이런 에러가 나타납니다.

Parse error: syntax error, unexpected T_VARIABLE in /home/hosting_users/maxtestpage/www/skin/mw.builder/mw.basic.3/com_menu.php on line 66

$sql "select count(wr_id) as cnt from $g4[write_prefix]{$smalls[$j][bo_table]} where wr_is_comment > -1 and ca_name = '{$smalls[$j][ca_name]}' and wr_datetime > '$new_datetime'";

 

여기에  and wr_is_comment​ = 0

을 추가하시면 될것 같습니다.

답변에 대한 댓글 1개

오류가 납니다. ㅠ

답변을 작성하려면 로그인이 필요합니다.