Reply to Re: Add 1 Year to current date ?

Your name:

Reply:


Posted by Gordon Burditt on 12/08/36 11:27

>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;
>
>< 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

I would replace '$nextyear' in the MySQL query with:
adddate(now(), INTERVAL 1 YEAR)

Gordon L. Burditt

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация