Bonjour,
je fais ce code et j'ai une erreur que je ne comprends pas, quelqu'un pourrait-il m'en dire plus ?
le code :
$req = $bdd->prepare('INSERT INTO phrasejour (auteur-phrase, phrase) VALUES(?, ?)');
$req->execute(array($_POST['auteur'], $_POST['phrase']));
$req->closeCursor();
L'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 '-phrase, phrase) VALUES('Auteur ', 'Phrase test')' at line 1
Cordialement,
J
Partager