Advertisement

05.24.2008 at 08:58PM PDT, ID: 23430928
[x]
Attachment Details

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

Asked by fastfind1 in PHP and Databases, MySQL, WebApplications

Tags: PHP, MySQL

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?Start Free Trial
[+][-]05.24.2008 at 09:17PM PDT, ID: 21641448

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.24.2008 at 09:18PM PDT, ID: 21641451

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.24.2008 at 09:22PM PDT, ID: 21641459

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.24.2008 at 09:23PM PDT, ID: 21641462

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP and Databases, MySQL, WebApplications
Tags: PHP, MySQL
Sign Up Now!
Solution Provided By: pain_is_relative
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.24.2008 at 09:31PM PDT, ID: 21641471

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628