复制代码 代码如下:
$stime="2009-05"; 当前月,选择的查询月份。
$stimes="200905";
$mintime=1241107200(2009-05-01 00:00:00);
$maxtime=1243785600(2009-06-01 00:00:00); 月份+1
$sql="select * from t_list where del=0 and ( (ktime>={$mintime} and ktime<$maxtime) or (ktime<$mintime and dtime-5*24*60*60>$maxtime and PERIOD_DIFF(".$stimes.",DATE_FORMAT(FROM_UNIXTIME(ktime-5*24*60*60),/"%Y%m/")) mod jmonth=0) ) order by ktime desc";
新闻热点
疑难解答