查询“今天”的所有记录:
$today=strtotime(date('y-m-d',$time()));
$tomorrow=mktime(0,0,date("s",$today)-1,date("m",$today),date("d",$today)+1,date("Y",$today));//注意此句date("s",$today)-1,这样查询出来的结果才能更加准确。
SQL语句如下:
SELECT * FROM 表名 where 字段 BETWEEN $today AND $tomorrow"