So I've been trying to solve this one on my own for a few hours and it's driving me crazy.
I'm just trying to put a date into a mySQL database, the code looks like this:
$timeStarted = date("Y-m-d H:i:s", time());
$sqlquery = "INSERT INTO deviceStats (currTime, ...) VALUES ($timeStarted, ...)";
mysql_query($sqlquery);
echo $timeStarted;
My ajax return is telling me that $timeStarted is in the propper format, it's giving the right time, but if I have this one variable in my query, it won't run. the currTime field in the DB is set to datetime, so it should work.