Bonjour,
Je me bats avec un bout de code qui se charge de faire un insert via la PDO.
Voici le code :
Et voici l'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 $req_ajout_serv=$bdd_auth->prepare ('INSERT INTO top_serveurs (id, nom, c_descr, l_descr, url_ban, type, version, website, slot, statut) VALUES (" ", :nom, :c_descr, :l_descr, :url_ban, "0", :version, :website, :slot, "1"'); $req_ajout_serv->execute(array( 'nom'=>htmlspecialchars($_POST['nom'], ENT_QUOTES), 'c_descr'=>htmlspecialchars($_POST['c_descr'], ENT_QUOTES), 'l_descr'=>htmlspecialchars($_POST['l_descr'], ENT_QUOTES), 'url_ban'=>htmlspecialchars($_POST['url_ban'], ENT_QUOTES), 'version'=>htmlspecialchars($_POST['version'], ENT_QUOTES), 'website'=>htmlspecialchars($_POST['website'], ENT_QUOTES), 'slot'=>$_POST['slots'], ));
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\SOAP_debug\top\index.php on line 25
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\SOAP_debug\top\index.php on line 25
Merci d'avance !![]()
Partager