统计今日、昨日的帖子数量,php mysql 语句 该如何书写?急!!!MySQLPHP昨日今日帖子数量
解决方案 »
- 我又来问题了 ZF框架的问题
- PHP缓存作怪还是Apache没配置好
- 易宝支付接口开发支付成功后通信问题
- array_slice函数的不解
- 请教各位关于搜索按关键词密度排序的问题 多谢了~
- 网站输入域名访问不了,必须要重新启动WAMP才能访问,但是重启过后隔一会又不行了?这是怎么回事?
- php做的一个RPG游戏...不知道有人发过了没..
- php对文件管理,那里有较好的脚本!
- 如何删除一个非空目录?
- 有请 Lostinet
- php ajax 时候出现 Uncaught TypeError: Cannot read property 'cellphone' of undefined
- php中mvc的问题
select count(id) from table where datetime=curdate() 今天
$today_rows="select count(*) from table where tb_send_date>='".date('Y-m-d 00:00:00')."' and tb_send_date<='".date('Y-m-d 23:59:59')."'";//今天$tomorrow=date("Y-m-d",strtotime("-1 day"));
$tomorrow_rows="select count(*) from table where tb_send_date>='".$tomorrow." 00:00:00' and tb_send_date<='".$tomorrow." 23:59:59'";;//昨天曾有人教我,mysql中where 子句尽量少用函数,因为会导致索引无效
额,你说的where字句的函数 是sql的吧,貌似你搞错了
select count(*) from table where date_format(tb_send_date,"%Y-%m-%d")=curdate() 昨天
select count(*) from table where date_format(tb_send_date,"%Y-%m-%d")=DATE_SUB(curdate(),INTERVAL 1 DAY)
额,你说的where字句的函数 是sql的吧,貌似你搞错了
你想简单化的话,最好把你的数据库改为时间戳,好比较也好处理
额,你说的where字句的函数 是sql的吧,貌似你搞错了
你想简单化的话,最好把你的数据库改为时间戳,好比较也好处理
额,你说的where字句的函数 是sql的吧,貌似你搞错了sorry,是sql