bien , voici ma requète SQL. Je le répète, normalement la syntaxe est bonne parceque ca fonctionne sur l'un des serveurs.
$query = "INSERT INTO db
(wei, type, auteur, date, titre, text, image, url, email, valid, valid_2, cible)
VALUES
($poids,
'".$_POST['type']."',
'".htmlspecialchars($nom)."',
'".$date."',
'".htmlspecialchars($_POST['titre'])."', '".htmlspecialchars($_POST['texte'])."',
'".$ext."',
'".htmlspecialchars($_POST['url'])."', '".htmlspecialchars($_POST['email'])."',
'".$portail."',
'".$mail."',
'".htmlspecialchars($_POST['cible'])."')";
Voici l'erreur renvoyée quand je met un appostrophe dans le texte par exemple :
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 'image', 'l'imlage l'imaaa',, , , 'wait', 'wait', 'office')' at line 4 dans
INSERT INTO db
(wei, type, auteur, date, titre, text, image, url, email, valid, valid_2, cible)
VALUES (0, 'news', 'john', '2009-04-29', 'l'image', 'l'image l'imaaa',, , , 'wait', 'wait', 'office')
Donc ma question serait, pourquoi le htmlspecialchars marche sur un serveur et pas sur l'autre ?