On 4/30/06, Ross <[EMAIL PROTECTED]> wrote:
soted it ! Thanks.

please enlighten us in case someone else has the same sort of issue...

""Ross"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I am using this to compare todays date with dates retieved from a database.
>The problem is it seem to retrun the same value for the $then variable
>
> and can be seen ot working here....
>
> http://nationalservicesscotland.com/cms/time.php
>
>
> <?
>
> session_start();
> include ('../shared/connect.php');
>
> $query= "SELECT headline, id, expiry, link FROM events";
>
> $result= mysql_query($query);
>
>
>   while  ($row = @mysql_fetch_array($result, MYSQL_ASSOC)){
>
>
> $compare= explode("/", $row['expiry']);
>
>
> $day = isset($compare[0]) ? $compare[0] : null;
> echo "day is $day<br>br><br>";
> $month = isset($compare[1]) ? $compare[1] : null;
> echo "month is $month<br>br><br>";
> $year = isset($compare[2]) ? $compare[2] : null;
> echo "year is $year<br>br><br>";
>
> $then = mktime(0,0,0,$month,$day, $year);
>
> $now = mktime (0,0,0,date("m"),date("d"),date("Y"));
>
>
> $diff = $now - $then;
>
> echo "today is $today<BR>";
> echo "expiry date is $ross<br>";
> echo "now mktime value is is $now<br>";
> echo "then mkvalue is $then<br><br>";
> if ($diff < 0 ) {
> /*$text = stripslashes ($row['headline']);
>  $newtext = wordwrap($text, 12, "\n", 1);
>  $link=$row['link'];
>  echo $newtext."<a href=\"$link\">...read more</a>"."<br /><br />";*/
>
> }
> }
> ?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to