Shaitan00
April 6th, 2009, 12:56 AM
Within my PHP5 application I need to set an expiry date when inserting/updating into the MySQL database - but honestly I've got no clue how...
Specifically - it needs to be one month from the day of the insert/update (thus one month past Now())
Currently I've got the following working fine:
UPDATE item SET expdate=Now() WHERE pid=1;
Obviously this set the expdate to the current date, I've tried doing Now()+1 (didn't work), was looking into ADDDATE (couldn't get it to work), etc...
How, in MySQL, can I add 1 month to Now()?
Any help would be much appreciated.
Thanks,
Specifically - it needs to be one month from the day of the insert/update (thus one month past Now())
Currently I've got the following working fine:
UPDATE item SET expdate=Now() WHERE pid=1;
Obviously this set the expdate to the current date, I've tried doing Now()+1 (didn't work), was looking into ADDDATE (couldn't get it to work), etc...
How, in MySQL, can I add 1 month to Now()?
Any help would be much appreciated.
Thanks,