Bonjour,

Je ne comprends pas le message d'erreur :

( ! ) 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
Voici mon code :

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]);
?>
Ma requête semble pourtant correcte

merci pour votre aide