精華 帝國PHP系統CMS統計指定時間內文章的數量
<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")?> 如果要改成周,月只需要把數字6或者12改成相應的時間就行了,表前綴記得修改下喲!