joecooper Posted October 29, 2013 Share Posted October 29, 2013 $newtime = date("Y-m-d H:i:s", time() + 600); mysql_query("UPDATE rounds SET clock = $newtime WHERE `round`='$CurrentRound' ") or die(mysql_error()); //update DB This code is failing to add the current time (+10 mins) to the MySQL database. The cell in the database is datetime format. I had done this before, but upon rewriting the code, it has stopped working. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted October 29, 2013 Share Posted October 29, 2013 date/time values in a query statement are literal strings and must be enclosed by single-quotes. without single quotes, 2013-10-29 is a mathematical subtraction problem (i.e. 1974.) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.