You can (mySQL, right?) do the following:

UPDATE table SET date=(date+INTERVAL 10 DAYS);

so if date there was 04-28, it will be added 10 more days and so will become
05-08

Use SQL for this things, it treats dates as 'dates' while PHP treats them as
integers and strings.




Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com




-----Original Message-----
From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 22, 2001 7:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Incrementing dates


How do I increment dates past the turn of the month (or year)?
Say I've got a booking of equipment A for the 28 April to 5 May and want to
add each instance to a calendar (mysql table).
Can I increment the variable (format 2001-04-28) holding the date
($txtDate++) somehow so that it doesn't add the 31, 32 and 33 of April?

Martin S.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to