|
Posted by iuz on 11/24/24 11:27
Syl wrote:
> I've been through the php.net docs, and this newsgroup - and all seems
> to be configured properly, but this statement is still not working:
>
> switch ($level) {
> case 1:
> $nextyear = mktime(0,0,0,date("Y")+1,date("m"),date("d"));
> $nextyear = strftime("%Y%m%d",$nextyear);
> break;
date('Y-m-d', 31536000) // this return the next year string (60*60*24*365)
> < snip case >
>
> $query = "INSERT INTO users VALUES (NULL, '$username',
> password('$userpassword'), $level, '$fname', '$lname', '$tel',
> '$email', '$addr', '$city', '$prov', '$country', '$pcode', 'comm',
> '$today', '$nextyear')";
>
> Any ideas ? It's a date field in the table - it displays:
> YYYY-MM-DD --> 2005-09-22
>
> Thanks!
by the way in sql is probably better something like..
> '$today', date_add(now(), INTERVAL 1 year ))";
leaving the responsability of the year add directly to the dbms..
--
www.iuz-lab.info
Navigation:
[Reply to this message]
|