$myrow[time]的值是多少???
时间比较不能直接比较的

解决方案 »

  1.   


    <?PHP
    $Date_1="2003-7-15";//也可以是:$Date_1="2003-6-25 23:29:14";
    $Date_2="1982-10-1";
    $Date_List_1=explode("-",$Date_1);
    $Date_List_2=explode("-",$Date_2);
    $d1=mktime(0,0,0,$Date_List_1[1],$Date_List_1[2],$Date_List_1[0]);
    $d2=mktime(0,0,0,$Date_List_2[1],$Date_List_2[2],$Date_List_2[0]);
    $Days=round(($d1-$d2)/3600/24);
    Echo   "偶已经奋斗了 $Days 天^_^";
    ?>
      

  2.   

    如果$myrow[time]是日期格式的字符串则不能直接比较
    先转换成天数
    if((date(Ymdhsi)-strtotime($myrow[time])/(60*60*24))<=7)
         {
            echo "(<font color=red>new</font>)";
         }
      

  3.   

    看错了,晕
    应该是这样
    if(((time()-strtotime($myrow[time]))/(60*60*24))<=7)
         {
            echo "(<font color=red>new</font>)";
         }
      

  4.   

    if(((time()-strtotime($myrow[time]))/(60*60*24))<=7)
         {
            echo "(<font color=red>new</font>)";
         }
    这才是正确的,寻梦的是正确的,我是这么做的
      

  5.   

    if(strtotime("-7 day") < strtotime($myrow[time]))