Bonjour,
j'ai un probleme quand j'envoie mon formulaire voici mon erreur
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 'WHERE id= ""' at line 1
voici la ligne en question je l'ai mis en gras
<?
//connextion a la base de donnee
mysql_connect('localhost', 'axxxxx', 'xxxxxx');
mysql_select_db("auto7837_auto");
$id = $_POST['id']; // recuperation de l'id a modifier
if(is_numeric($id) && $id) {
$sql='SELECT * FROM servicenonpubliee WHERE id="'.$id.'"';
$req=mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_array($req)) {
$typedannonce=$row['typedannonce']; $email=$row['email']; $titre=$row['titre']; $message=$row['message'];
}
}
if(isset($_POST['envoyer'])) {
$id = $_POST['id']; $typedannonce=$_POST['typedannonce']; $email=$_POST['email']; $titre=$_POST['titre']; $message=$_POST['message'];
//on modifie les images la requete
$sql=' UPDATE servicenonpubliee SET typedannonce="'.$typedannonce.'", email="'.$email.'", titre="'.$titre.'", message="'.$message.'", WHERE id= "'.$id.'" ';
mysql_query($sql) or die(mysql_error());
echo 'Vos infos ont été modifiées.';
}
else{
?>
merci
