I find it very hard and i cannot explain why i cannot update a datetime object but when i am inserting a row into the table with the exact same way, it works.
$now= date("Y-m-d H:i:s");
$query = "UPDATE students SET lastvisit=". $now. " WHERE id=4";
I used the exact same way(with $now variable and then pass it into VALUES() ) and the insert statement was successful. Do i have to do it with another way?