> Subject: Re: [PHP-DB] Date and time issues
> 
> If you are using MySQL, you may profitably investigate the function
> DATE_ADD( date, INTERVAL )
> 
> Ignatius J. Reilly
Thanks Ignatius! Fred.
This did it:
$interval="1 HOUR";
$subscr_text="1 sessie";
                    }
else if ($subscr_type==3) {
$interval="90 DAY";
$subscr_text="abonnement 3 maand";
                    }
else if ($subscr_type==12) {
$interval="1 YEAR";
$subscr_text="abonnement 12 maand";
                    }
$sql = "SELECT * FROM subscriptions WHERE ((DATE_ADD(act_date, INTERVAL
$interval) > CURDATE()) AND (us_id= \"$sel_us_id\"))";//validate subscritoin
date
$result = @mysql_query($sql, $connection) or die("Error #". mysql_errno() .
": " . mysql_error());
$num = @mysql_num_rows($result);
if ($num!=0) //valid subscription all checks passed
{   

> ____________________________________________
> ----- Original Message -----
> From: "Frederik Feys" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, November 04, 2002 10:32 PM
> Subject: [PHP-DB] Date and time issues
> 
> 
>> Hi all,
>> I searched for 5 hours, trying to solve my (newbie?) problem. I want to
> pick
>> today's date and add XXX days to it. Its setup to validate membership
>> period. Now my column is of date type. Aswell, I want to pick current time
>> and add 1 hour to it. Here aswell, sessions expire after one hour.
>> Can anybody help me?
>> Thanks
> 
> 


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

Reply via email to