建表的时候加个字段表示日期,然后查sql手册...
select count(*) from `table` where `date`='{某天}'
select count(*) from `table` where date_format(`date`,'%V')='{某周}'
select count(*) from `table` where date_format(`date`,'%c')='{某月}'
select count(*) from `table` where `date`='{某天}'
select count(*) from `table` where date_format(`date`,'%V')='{某周}'
select count(*) from `table` where date_format(`date`,'%c')='{某月}'
$stime = GetMkTime("{$y}-{$m}-01");
$row = $dsql->GetOne("Select count(ID) as dd From `table` where date>=$stime; ");
return $row['dd'];
select count(*) as cnt,week(editdate) as weekflg from projects where year(editdate)=2007 group by weekflg每月
select count(*) as cnt,month(editdate) as monthflg from projects where year(editdate)=2007 group by monthflg每天
select count(*) as cnt from projects group by date(editdate)