php,mysql查询当天的记录

来源:互联网 发布:js保留两位小数 编辑:程序博客网 时间:2024/06/05 03:45

我插入数据库的日期格式是时间戳,

select count(1) from edian_member where opencardstore=4  and TO_DAYS(FROM_UNIXTIME( opencardtime, '%Y%m%d' ))=TO_DAYS(NOW()) 

如果插入的日期格式就需要转化

select count(1) from edian_member where opencardstore=4  and TO_DAYS(opencardtime)=TO_DAYS(NOW()) 


0 0
原创粉丝点击