用帝国ECMS 5.1整合PHPwind论坛,在ECMS首页用sql查询调用论坛所有栏目中最新的帖子: 
'select subject as title,tid as id from pw_threads order by tid desc limit 10' 现在我想随机调出论坛中最近15天最热门的帖子,请问应怎样修改? 

解决方案 »

  1.   

    select 
      subject as title,
      tid as id 
    from pw_threads
    where date_sub(curdate(),interval 15 day) <= date(时间字段) --最近15天
    order by rand() limit 10   --随机取10条
      

  2.   

    谢谢回复。没有调出来:
    'select subject as title, tid as id from pw_threads where date_sub(curdate(), interval 15 day) <= date(15) order by rand() limit 10'
      

  3.   

    谢谢回复。已经调出来了: 
    'select subject as title, tid as id from pw_threads where date_sub(curdate(), interval 15 day) order by rand() limit 10'
      

  4.   

    谢谢回复。已经调出来了: 
    'select subject as title, tid as id from pw_threads where date_sub(curdate(), interval 15 day) order by rand() limit 10'