Page 1 of 1

[solved] request that doesn't work !

Posted: Tue Feb 10, 2009 3:53 am
by Plata
Hi everyone

I'm sorry if the question is basic but i don't arrive to find the solution for the moment :

the following request doesn't work :

Code: Select all

INSERT INTO cec_gdecarrere.dictionnaire_langue(
id_dictionnaire,
id_langue,
texte
)(
 
SELECT id_dictionnaire, 1, 'Generer un nouveau mot de passe'
FROM cec_gdecarrere.dictionnaire
[i]WHERE nom = 'GENERER_UN_NOUVEAU_MOT_DE_PASSE';[/i]
)


and mySQL told me :
#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 '' at line 9
During my searching, if you could help me please ...
thanks by advance !

Re: request that doesn't work !

Posted: Tue Feb 10, 2009 4:44 am
by sergio-pro
Hi

Try removing ; from the select statement

Re: request that doesn't work !

Posted: Tue Feb 10, 2009 4:58 am
by Plata
yeah ! It works now. I forgot the ")" at the end of the select statement and i removed the ";" so

Code: Select all

INSERT INTO cec_gdecarrere.dictionnaire_langue(
id_dictionnaire,
id_langue,
texte
)(
 
SELECT id_dictionnaire, 1, 'Addresse'
FROM cec_gdecarrere.dictionnaire
WHERE (
nom = 'ADDRESSE'
)
[b])[/b]
thanks and bye :offtopic: