mysql查询当天的所有信息:
select * from test where year(regdate)=year(now()) and month(regdate)=month(now()) and day(regdate)=day(now())简单的写法:
select * from table where date(数据库中的时间值) = 你要比较的日期值 ;
date()函数获取日期部分, 扔掉时间部分,然后与当前日期比较即可
mysql查询当天的所有信息:
select * from test where year(regdate)=year(now()) and month(regdate)=month(now()) and day(regdate)=day(now())