Problème d'ajout

Résolu
BioSs007 Messages postés 19 Date d'inscription samedi 28 février 2004 Statut Membre Dernière intervention 6 septembre 2013 - 3 déc. 2007 à 20:24
BioSs007 Messages postés 19 Date d'inscription samedi 28 février 2004 Statut Membre Dernière intervention 6 septembre 2013 - 4 déc. 2007 à 00:06
Bonjour à tous,
J'ai un problème de caractères spéciaux qui ne veut pas rentrer dans ma table MySQL !
Auriez vous une solution ?
Voici le message d'erreur :

Erreur SQL !
INSERT INTO bioss_favoris(id,nom,url,desc) VALUES('','xxxxx','http://xxxxx.skyrock.com','I ? ComPliCaTeD

I ? IRoNiK

I ? FunNy

I ? CharminG

I ? Mysterious

I ? CyNiCaL

I ? NaSty

I ? shitting


???

???

??????

????

??

?


i love you forever

',)
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 'desc)
VALUES('','xxxxxx','http://xxxxx.skyrock.com','I ? ComPli' at line 1

J'ai testé htmlentities ainsi que htmlspecialschars mais aucun des deux ne marche...

D'avance merci

5 réponses

neigedhiver Messages postés 2480 Date d'inscription jeudi 30 novembre 2006 Statut Membre Dernière intervention 14 janvier 2011 19
3 déc. 2007 à 23:23
Salut,

DESC est un mot réservé de MySQL. Tu ne peux donc pas t'en servir pour nommer une colonne.
3
cs_lowkey Messages postés 260 Date d'inscription jeudi 31 mai 2007 Statut Membre Dernière intervention 5 novembre 2010 1
3 déc. 2007 à 20:58
As-tu essayé mysql_real_escape_string()?

<hr />
lowkey
0
BioSs007 Messages postés 19 Date d'inscription samedi 28 février 2004 Statut Membre Dernière intervention 6 septembre 2013
3 déc. 2007 à 22:11
Salut Lowkey et merci pour ta réponse...
Mais celà ne marche pas...
J'obtiens le message d'erreur suivant :

Erreur SQL !
INSERT INTO bioss_favoris(id,nom,url,desc) VALUES('','xxxxx','http://xxxxx.skyrock.com','I ? ComPliCaTeD
\r\nI ? IRoNiK
\r\nI ? FunNy
\r\nI ? CharminG
\r\nI ? Mysterious
\r\nI ? CyNiCaL
\r\nI ? NaSty
\r\nI ? shitting
\r\n
\r\n
\r\n???
\r\n???
\r\n??????
\r\n????
\r\n??
\r\n?
\r\n
\r\ni love you forever

')
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 'desc)
VALUES('','xxxxx','http://xxxxx.skyrock.com','I ? ComPli' at line 1
0
cs_lowkey Messages postés 260 Date d'inscription jeudi 31 mai 2007 Statut Membre Dernière intervention 5 novembre 2010 1
3 déc. 2007 à 23:19
Tu dois avoir un problème sur un de tes champs (vérifie l'orthographe), car je l'ai testé chez moi et elle passe

<hr />
lowkey
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
BioSs007 Messages postés 19 Date d'inscription samedi 28 février 2004 Statut Membre Dernière intervention 6 septembre 2013
4 déc. 2007 à 00:06
Merci neigedhiver ^^
Problème règler grâce à toi ^^
0
Rejoignez-nous