troubleshooting Question

Select Date from MySQL using PHP - Need PHP add 10 days to date, keep MySQL date format, update MySql table with new Date in correct format

Avatar of fastfind1
fastfind1 asked on
PHPMySQL ServerWeb Applications
5 Comments1 Solution3509 ViewsLast Modified:
Using PHP and MySQL, have a table that has a field with the DATE data type.  Hence all records have a format similar to 2008-05-24.  Using PHP I can select the date from the mysql table and assign it a variable ($date_old).  Then, using PHP I need to add 10 days to the date and assign the new date to a new variable $date_new.  How do I do this and preserve the format.  

So if $date_old = '2008-05-24', I need $date_new = '2008-06-03'

How can I do this using PHP?  If I cant use PHP, how can I do this using something compatible with PHP and MySQL?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros