채택완료

이 쿼리에 문제가 있는지 확인해 주실 분 계신가요

<?
$que = "select count(*) as cnt from g4_write_테이블id where is_comment = 0 and datediff( now(), wr_datetime ) = 0";
$f = sql_fetch( $que );
echo $f["cnt"];
?>​

 금일 게시판의 새글 개수 나타내는 쿼리인데

아무리 해도 숫자가 안나오네요

오류가 나거나 하지는 않습니다

|

답변 2개

채택된 답변
+20 포인트

​select count(*) as cnt from g4_write_테이블id where is_comment = 0 and datediff( now(), wr_datetime ) = 0  ==>> ​select count(*) as cnt from g4_write_테이블id where wr_is_comment = 0 and datediff( now(), wr_datetime ) = 0

이렇게 바꾸세요 

2014-10-28 (화) 18:50:41

select count(*) as cnt from db테이블명 where wr_is_comment = 0 and datediff( now(), wr_datetime ) = 0

is_comment  ---> wr_is_comment 이게 맞습니다 

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