建表的时候加个字段表示日期,然后查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')='{某月}'

解决方案 »

  1.   


    $stime = GetMkTime("{$y}-{$m}-01");
    $row = $dsql->GetOne("Select count(ID) as dd From `table` where date>=$stime; ");
    return $row['dd'];
      

  2.   

    我的日期字段是完整日期,有时间,所以等于某日期查不到select   count(*)   from   projects   where   editdate='2007-11-9' 
      

  3.   

    语句就是select count(*) 这一类的呗其他就根据你日期的格式,给个最小或者最大的范围呗如select count( * ) from projects where editdate >= '2007-11-9 00:00:00' and editdate <= '2007-11-9 24:00:00';周和月也是同样道理,只要得到起始和结束的日期就可以了呗
      

  4.   

    每周的
    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)