精華 帝國(guó)PHP系統(tǒng)CMS統(tǒng)計(jì)指定時(shí)間內(nèi)文章的數(shù)量
<p>一句代碼就可解決:</p>
12小時(shí):<?=$empire->gettotal("select count(*) as total from phome_ecms_表 where newstime>UNIX_TIMESTAMP()-12*3600")?> 6小時(shí):<?=$empire->gettotal("select count(*) as total from phome_ecms_表 where newstime>UNIX_TIMESTAMP()-6*3600")?> 如果要改成周,月只需要把數(shù)字6或者12改成相應(yīng)的時(shí)間就行了,表前綴記得修改下喲!