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