sql 퀴리문 코멘트는 빼고는 어떻게 하나요?
본문
새로운 글이 올라오면 뉴 아이콘이 나타나는데 코멘트는 빼고는 어떻게 수정을 해야 하나요 ?
<? // 소메뉴 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
$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'"
;
$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
을 추가하시면 될것 같습니다.
답변을 작성하시기 전에 로그인 해주세요.