呵呵,临时写的,里面漏洞百出,例如在统计过程中少写了class = '$class[id]'等,希望大家不要介意 ^_^

解决方案 »

  1.   

    select count(id) from news group by class order by ..limit N,N
      

  2.   

    select count(id) from news group by class order by ..limit N,N这样不行呀,不能同时统计今日的新闻数量、图片新闻数量、已审核的新闻数量不知道能不能这么写
    select count(id) as newsId , count(img_path!='') as imgNum, count(status='1') as status from news group by class order by ..limit N,N呵呵,用where判断条件不知道怎么写
      

  3.   

    $sql=" select .... where 1 and 图片新闻数量 and 已审核的新闻数量";
    $sql.=" and TO_DAYS(NOW()) - TO_DAYS(addtime) =0";
    $sql.=" ... ";