Probème requete message d'erreur ...
Posté : 02 févr. 2017, 22:15
Salut tout le monde voilà que j'ai finis mon bout de code mais j'ai un soucis sur l'integration avec ma requete :
Warning: PDOStatement::execute(): 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 'Assas','75006','PARIS 06','0.0','0.0',' 16:00','8','75','13','2400744619','','1'' at line 1 in C:\wamp\www\azerty\integration.php on line 296
Voici ma requete :
Merci pour votre aide
Warning: PDOStatement::execute(): 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 'Assas','75006','PARIS 06','0.0','0.0',' 16:00','8','75','13','2400744619','','1'' at line 1 in C:\wamp\www\azerty\integration.php on line 296
Voici ma requete :
// Insertion
$req = $bdd->prepare("INSERT INTO `loisirs` (id_simply_user,titre,url_rewrite,price,photo,url_fnac,date_debut_sortie,date_fin_sortie,description,street,postcode,city,geoLatDeg,geoLongDeg,horaire,id_region,id_departements,id_type_loisirs,number,manufacturer,valide) VALUES ('$id_simply_user','$titre','$url_convertis','$price','$photo','$url_fnac','$date_debut_sortie', '$date_fin_sortie', '$description','$street','$postcode','$city','$geoLatDeg','$geoLongDeg','$horaire','$region','$departement','$id_type_loisirs','$number','$manufacturer','$valide')");
$req->execute(array(
'id_simply_user'=>$id_simply_user,
'titre'=>$titre,
'url_rewrite'=>$url_convertis,
'price'=>$price,
'photo'=>$photo,
'url_fnac' => $url_fnac,
'date_debut_sortie' => $date_debut_sortie,
'date_fin_sortie' => $date_fin_sortie,
'description' => $description,
'street' => $street,
'postcode'=>$postcode,
'city'=>$city,
'geoLatDeg'=>$geoLatDeg, //
'geoLongDeg'=>$geoLongDeg, //
'horaire'=>$horaire, //
'id_region'=>$region,
'id_departements'=>$departement,
'id_type_loisirs'=>$id_type_loisirs,
'number'=>$number,
'manufacturer'=>$manufacturer,
'valide'=>$valide
)) or die('Problème lors de l\'insertion');
}
}
Est ce problème d'éventuel apostrophe ou autre je ne sais pas ...Merci pour votre aide