php:
$today=strtotime(date(“Y-m-d”));
$date=strtotime(’2009-5-5′);
if ($date-$today<2592000){…};
把$data与当前日期比较,如果在30天内
mysql:
select * from table where TO_DAYS(date)-TO_DAYS(NOW())<=30;
选择当前日期后30天内的数据
上一篇:php写的smtp类
没有评论▼
我来说两句
