mysql_query("UPDATE tablename SET date = DATE_ADD(DATE(NOW() + INTERVAL 1 WEEK), INTERVAL 17 HOUR), INTERVAL 30 MINUTE)
WHERE idevent = '2'")
or die(mysql_error());
I want to add 7 days to the date, but have the time aspect of datetime manually set. I have the code above, which works for the hour, but as soon as I add minutes it errors saying SQL syntax error.
Any ideas?
You need another DATE_ADD()
at the front of that expression, since you're doing two additions.
mysql_query("UPDATE tablename SET date = DATE_ADD(DATE_ADD(DATE(NOW() + INTERVAL 1 WEEK), INTERVAL 17 HOUR), INTERVAL 30 MINUTE) WHERE idevent = '2'");
//-------------------------------------^^^^^^^^^^^^^^^^^^^^