I'm trying to add date and time to a datetime field in mysql database using PHP.
My datetime in mysql database is stored like this:
2015-01-20 05:10:17
I tried to add 5 days to that field like this:
$Date = date();
$end_date = date("Y, n, j, G, i, s", strtotime($Date. ' + 5 days'));
UPDATE myTable SET end_date='$end_date' WHERE randKey='$id'
but when I look at the database for updates I see the end_date field like this:
0000-00-00 00:00:00
which means it has been updated but everything has been set to 0 for some reason!
could someone please advise on this issue?
Thanks in advance.