create table table_name(id int primary key,register_time int(10));
/* 查询2015-12-01 至 2015-12-14 */
// 开始的时间戳
$startUnix = 1448899200; // 2015-12-01 00:00:00
// 结束的时间戳
$endUnix = 1450108800; // 2015-12-15 00:00:00
for($i = $startUnix; $i < $endUnix; $i += 86400){ // 86400为1天的秒数
// 查询
$sql = 'select count(*) from table_name where register_time>= '.$i.' and register_time < '.$i + 86400;
// 执行查询
}
/* 查询2015-12-01 至 2015-12-14 */ // 开始的时间戳 $startUnix = 1448899200; // 2015-12-01 00:00:00 // 结束的时间戳 $endUnix = 1450108800; // 2015-12-15 00:00:00 $sql = 'select count(id) as register_count, FROM_UNIXTIME(register_time, '%Y-%m-%d') as datetime from table_name where register_time>= '.$startUnix.' and register_time < '.$endUnix group by datetime; // 执行查询 ...
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有