Bonjour j'aimerai savoir si la syntaxe de ma requête est correcte car je fait face à l'erreur suivante lorsque je l’exécute :

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 '' at line 1' in C:\wamp\www\....\acceuil.php on line 242

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 '' at line 1 in C:\wamp\www\...\acceuil.php on line 242


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
 
// On se connecte à MySQL (LIGNE 238)
$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
$bdd = new PDO('mysql:host=localhost;dbname=projet_isep', 'root', '', $pdo_options);
$req = $bdd->prepare( "DELETE FROM deals WHERE id = '".$_POST['suppr']."', ");
$req->execute();
$req ->closeCursor(); // Termine le traitement de la requête