베스트 추출 하루를 1주로 정보
베스트 추출 하루를 1주로본문
매일의 조회수를 집계하여 베스트를 추출하고 있는데요..
이것을 1주 단위로 바꾸려면 어떻게 해야 하나요...?
$oneday = date("Y-m-d H:i:s", $g4[server_time]-60*60*24);
$sql_where = " category_type = '2' and wr_is_comment = 0 and wr_datetime >= '$oneday' ";
이 부분을 바꿔야 할 것 같은데... 알려주시면 감사하겠습니다!
이것을 1주 단위로 바꾸려면 어떻게 해야 하나요...?
$oneday = date("Y-m-d H:i:s", $g4[server_time]-60*60*24);
$sql_where = " category_type = '2' and wr_is_comment = 0 and wr_datetime >= '$oneday' ";
이 부분을 바꿔야 할 것 같은데... 알려주시면 감사하겠습니다!
댓글 전체
and wr_datetime >= '$oneday' ";
==>
and wr_datetime >= (curdate() - interval 7 day) ";
==>
and wr_datetime >= (curdate() - interval 7 day) ";
감사합니다! 잘 작동됩니다!
u7t