views:

26

answers:

1

HI

I Need to display an image when Category Update and that image display upto 3 days

i use this but not work

 $todaytime = time();
                $timestamp = $show_wallpaper['timestamp'];
                $timediffirence = "360000";
                $minus = $todaytime - $timestamp;


 if ($timediffirence > $minus) {
          $new = "<img src='$siteurl/images/new.gif' />";

       } else {
          $new = "";

        }

database info

      $sql = "SELECT SQL_NO_CACHE * FROM wallpaper WHERE categoryid = $catid order by wallpaperid desc LIMIT $from,$max_results";

so help me to fix it I do like this

IF Category Update then display this image for 3 days else remove image this is my task reply

+1  A: 

Firstly, $timediffirence is a number, it does not therefore need to be in double quotes, try this first:

$timediffirence = 360000;

Secondly, 360000 is not 3 days in seconds, it should be

((60 * 60) * 24) * 3 = 259200

Finally, try debugging by printing out the values of $minus and comparing it with $timediffirence

jakenoble
Not Work Full code please
Hassan
@Hassan. Sorry I forgot your my boss - I'll get right on it.
jakenoble