Bonjour,
Je ne comprends pas le message d'erreur :
Voici mon code :( ! ) 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 ' id_destinataire = '1', date_lecture = NULL' at line 1' in C:\wamp\www\pag\messages.php on line 44
( ! ) PDOException: 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 ' id_destinataire = '1', date_lecture = NULL' at line 1 in C:\wamp\www\pag\messages.php on line 44
Ma requête semble pourtant correcte
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <?php $user_id = $_SESSION['auth']->id; $pdo->prepare('UPDATE messages SET date_lecture = NOW() WHERE id_expediteur = ?, id_destinataire = ?, date_lecture = NULL')->execute([$_GET['idmbr'], $user_id]); ?>
merci pour votre aide
Partager