This topic is locked

adding 1 day to $value= $defvalues['purchase_date'

8/28/2006 6:17:12 PM
PHPRunner General questions
D
Dale author

This Im hoping is a very simple question.
How would I add 1 day to the
$value= $defvalues["purchase_date"];
in my purchases_add.php.
The value is a Date field in MySql database.
On creating a new invoice, I would like the purchase date to be 1 day later than the value stored in the

$defvalues["purchase_date"] which is being correctly set to the expiry date of the last purchase.

J
Jane 8/29/2006

Dale,
use DATE_ADD or DATE_SUB MySQL functions:

http://dev.mysql.com/doc/refman/5.1/en/dat...-functions.html

Here is an example:

$value = DATE_ADD($defvalues["purchase_date"], INTERVAL 1 DAY);