어제 등록된 글 수 계산 방법 정보
어제 등록된 글 수 계산 방법본문
현재 오늘 등록된 글의 수를 계산하는 건 다음과 같이 하고 있습니다.
<?
//오늘 등록된 글 수
$today_cont=@mysql_query("select wr_datetime "
."from $write_table where "
." (wr_is_comment = 0 "
." and date_format(wr_datetime,'%Y-%m-%d') = current_date() "
." ) ");
$today_cont_cnt=mysql_num_rows($today_cont);
?>
오늘 등록된 글 수: 총 <b>
<?=$today_cont_cnt?>
</b>개
이걸 활용하여 어제 등록된 글 수를 계산하는 건 어떻게 해야할까요?
어제 시간을 표현하는 여러 방법들을 사용해도 표현이 되지 않아 질문 올립니다.
감사합니다.
<?
//오늘 등록된 글 수
$today_cont=@mysql_query("select wr_datetime "
."from $write_table where "
." (wr_is_comment = 0 "
." and date_format(wr_datetime,'%Y-%m-%d') = current_date() "
." ) ");
$today_cont_cnt=mysql_num_rows($today_cont);
?>
오늘 등록된 글 수: 총 <b>
<?=$today_cont_cnt?>
</b>개
이걸 활용하여 어제 등록된 글 수를 계산하는 건 어떻게 해야할까요?
어제 시간을 표현하는 여러 방법들을 사용해도 표현이 되지 않아 질문 올립니다.
감사합니다.
댓글 전체
어제는 date("Y-m-d", strtotime("-1 day", time())) 이런 식으로 구하면 될 것 같은데요..