Bonsoir,
Voila 3h que je bloque sur un problème.
J'utilise UPDATE mais la base de données ne change pas et le script me renvoie une 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 'match='1', win='1' WHERE id='7'' at line 1' in C:\wamp\www\ggc\rate.php:40 Stack trace: #0 C:\wamp\www\ggc\rate.php(40): PDO->exec('UPDATE filles S...') #1 {main} thrown in C:\wamp\www\ggc\rate.php on line 40
Voici le code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 $req = $bdd->exec('UPDATE filles SET match='.$nb_match1.', win= '.$nb_win.' WHERE id = '.$win.''); $req2 = $bdd->exec('UPDATE filles SET match = '.$nb_match2.', lost = '.$nb_lost.' WHERE id ='.$lost.'');
Je suis en localhost sous wamp. Toutes les variables existes ainsi que la table "filles"
Merci d'avance,
Alexandre
Partager