帝国CMS模板调用今天当天或者24小时内的信息(两种写法)

其实有很多种写法,墨鱼说两种,欢迎其他小伙伴补充:

query('select id,title,titleurl from '.$dbtbpre.'ecms_news where newstime between '.$timedays.' and '.$timedaye.' order by newstime limit 10');
while($xinxi_row=$empire->fetch($xinxi_sql)){
?>
  • “>

 

下面的代码也可以,注意看第四行sql查询的区别

query('select id,title,titleurl from '.$dbtbpre.'ecms_news where newstime>='.$timedays.' and newstimefetch($xinxi_sql)){
?>
  • “>

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注