echo $date_str=strtotime("$date_now -7 day");===>echo $date_str=date( "Y-m-d", strtotime("$date_now -7 day") );

解决方案 »

  1.   

    也不行,是不是和 left jion 有关?
      

  2.   

    SELECT t.fid, f.name,t.author, t.tid, t.subject,t.views,from_unixtime(t.dateline) FROM cdb1_threads t LEFT JOIN cdb1_forums f ON f.fid=t.fid and from_unixtime(t.dateline)>='2006-04-17 00:00:00' ORDER BY views DESC LIMIT 0, 10 ,不行,不知道为什么?
      

  3.   

    ... and t.dateline>=1145203200 ...既然dateline是int类型,需要比较的数值也是int类型。干嘛还要做格式化呢?你的这个数据表字段设计的比较合理,直接存储秒数便于移植
      

  4.   

    我格式化的原因是:
    echo $date_str=strtotime("$date_now -7 day");
    老版本,上面的得到结果是 字符串,现在不格化也得到的结果,也不对,不知道哪里错了SELECT t.fid, f.name,t.author, t.tid, t.subject,t.views,from_unixtime(t.dateline) FROM cdb1_threads t LEFT JOIN cdb1_forums f ON f.fid=t.fid and t.dateline>=$date_str ORDER BY views DESC LIMIT 0, 10 ,不行,不知道为什么?
      

  5.   

    干脆用int算了,我觉得很多时候取出来的数据不只是显示,可能以后还有其他地方需要用到的,也就是说干脆把格式化的操作交到客户端的javascript去做。除非你的功能很简单且不需要考虑以后的话,就继续格式化咯