I have a database column called "worked", it is set to DATETIME type. I want this to hold the time that is inserted into it.
I get the date like this
$date = date('Y-m-d H:i:s');
I then echo it to check it like this
echo $date,"</br>";
Which displays
2014-10-21 21:35:12
So that works, but I now want to save that $date into the "worked" column, like this
$ins2 = mysqli_query($con,"UPDATE stats SET stats.worked = $date WHERE stats.id=$id2");
id2 is the ID of the user logged in and it is correct.
The problem is that it doesn't do anything!
Nothing happens, the field stays as "0000-00-00 00:00:00"