안녕하세요?
1. 게시판 카테고리(분류) 갯수 구하기 구문 입니다.
function category_count($ca_name='')
{
global $g5, $bo_table;
if ($ca_name) $sql_where = " where ca_name = '".$ca_name."' ";
else $sql_where = " where ca_name != '' ";
$row = sql_fetch(" select count(*) as cnt from".$g5['write_prefix'].$bo_table.$sql_where);
return $row['cnt'];
}
2. 위 구문의 카테고리(분류) 갯수에서 댓글 갯수를 제외하려고 합니다.
$row = sql_fetch(" select count(*) as cnt from".$g5['write_prefix'].$bo_table.$sql_where);
그래서 위에다가 where wr_is_comment = 0을 넣으려고 하는데 잘 안 됩니다.
오늘도 좋은 하루 되십시오~^^)
감사합니다.
답변 2개 / 댓글 2개
채택된 답변
+20 포인트
8년 전
$sql_where 에 이미 where 절이 있네요
and wr_is_comment=0
이렇게 해보세요~
답변에 대한 댓글 1개
8년 전
where wr_parent = wr_id
로 변경해보세요
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.