I have a little problem in php/mySql.
Here is the code :
$updateLastchange = "UPDATE lastchange SET student = ? date = ? WHERE tutor= ? ";
$req = $db->prepare($updateLastchange);
if($req->execute(array($_SESSION['toHelp'], $date, $_SESSION['email'])))
{
//some code that should be executed
}
You also have to know that "lastchange" actually contains the row where tutor = $_SESSION['email'], $_SESSION['toHelp'] is defined and date is just a date("Y-m-d H:i:s") created a bit earlier.
The problem is that the execute returns false, and I have a syntax error :
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'date = '2015-06-10 11:09:53' WHERE tutor= 'tutor''
I don't understand why ...
I use WAMP (I don't know if you need to know that).
Thank you for your help !