我有这个代码,它是显示在我的网站上阅读最多的文章,我需要的是使它显示在过去两天阅读最多的文章,而不是在整个文章
<div id="content_2" class="content">
<ul>
<?php
$mysm=mysql_query("select id,n_id,title,image,status,date from news where viwe > 0 and status=1 order by viwe DESC LIMIT 0, 7 ");
while($mydm=mysql_fetch_object($mysm)){?>
<li class="">
取当前日期,减去2天,并与日期列进行比较。
下面的查询将返回过去2天内查看的帖子:
select id,n_id,title,image,status,date
from news where viwe > 0 and status=1
and date >= (CURDATE() - INTERVAL 2 DAY) order by viwe DESC LIMIT 0, 7;