Error in your SQL syntax; check the manual that corresponds to y

Fermé
mina - 8 mai 2015 à 15:52
mpmp93 Messages postés 6652 Date d'inscription mercredi 13 avril 2011 Statut Membre Dernière intervention 28 septembre 2015 - 9 mai 2015 à 08:22
Bonjour,

moi code est :if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
$insertSQL = sprintf("INSERT INTO client(nom, prénom, email, password, adresse, wilaya, telephone, credit) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['nom'], "text"),
GetSQLValueString($_POST['prénom'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['password'], "text"),
GetSQLValueString($_POST['adresse'], "text"),
GetSQLValueString($_POST['wilaya'], "text"),
GetSQLValueString($_POST['telephone'], "int"),
GetSQLValueString($_POST['credit'], "double"));

mysql_select_db($database_ventes, $ventes);
$Result1 = mysql_query($insertSQL, $ventes) or die(mysql_error());
}
est le problem: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 '©nom, email, password, adresse, wilaya, telephone, credit) VALUES (NULL, NULL, ' at line 1

A voir également:

1 réponse

mpmp93 Messages postés 6652 Date d'inscription mercredi 13 avril 2011 Statut Membre Dernière intervention 28 septembre 2015 1 339
9 mai 2015 à 08:22
Bonjour,

Dans votre script, avant d'insérer les données, faites un

echo $insertSQL;

et regardez ce que ça affiche....

Cdlt
0