一句代码就可解决:
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改成相应的时间就行了,表前缀记得修改下哟!
本文摘自网络,不代表短经典网立场 https://www.duanjingdian.com/420.html