This is a discussion on parse error within the PHP Language forums, part of the PHP Programming Forums category; Hi, I'm really going crazy with this query : $insert = "INSERT INTO utilisateur(nom_utilisateur,mot_de_passe,prenom, " + "nom,...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I'm really going crazy with this query : $insert = "INSERT INTO utilisateur(nom_utilisateur,mot_de_passe,prenom, " + "nom,date_de_naissance,site_internet, " + "avatard,no_telephone,statut) VALUES " + "('$nom_utilisateur','$mot_de_passe','$prenom' , " + "'$nom,$date_de_naissance', " + "'$site_internet', " + "'/avatard/.$nom_utilisateur','$no_telephone', '1'"); I got Parse error: parse error, unexpected ')' at the last line thx for your kindly help |
|
|||
|
Alexandre wrote:
> > "'/avatard/.$nom_utilisateur','$no_telephone', '1'"); > Your closing bracket is placed after the end quote of the string. Your current statement reads $insert = "string"); which doesn't work very well ;) Roy W. Andersen -- ra at broadpark dot no / http://roy.netgoth.org/ "Hey! What kind of party is this? There's no booze and only one hooker!" - Bender, Futurama |
|
|||
|
Alexandre wrote:
> Hi, > > I'm really going crazy with this query : > > $insert = "INSERT INTO utilisateur(nom_utilisateur,mot_de_passe,prenom, " + > "nom,date_de_naissance,site_internet, " + > "avatard,no_telephone,statut) VALUES " + > "('$nom_utilisateur','$mot_de_passe','$prenom' , " + > "'$nom,$date_de_naissance', " + > "'$site_internet', " + > "'/avatard/.$nom_utilisateur','$no_telephone', '1'"); > > I got Parse error: parse error, unexpected ')' at the last line > > thx for your kindly help > "'/avatard/.$nom_utilisateur','$no_telephone', '1'"); should be "'/avatard/.$nom_utilisateur','$no_telephone', '1')"; NM -- convert uppercase WORDS to single keystrokes to reply |
|
|||
|
really thx for your response but it's still doesn't work, if I try to do a
simple echo $insert; I get this error message : 0 Erreurr SQL !0 I can't understand, how do you debug your query ? thx in advance "Roy W. Andersen" <roy-news@netgoth.org> wrote: >Alexandre wrote: >> >> "'/avatard/.$nom_utilisateur','$no_telephone', '1'"); >> > >Your closing bracket is placed after the end quote of the string. > >Your current statement reads $insert = "string"); which doesn't work >very well ;) > > >Roy W. Andersen >-- >ra at broadpark dot no / http://roy.netgoth.org/ > >"Hey! What kind of party is this? There's no booze >and only one hooker!" - Bender, Futurama |
|
|||
|
I found it :)
Alexandre <no@msn.com> wrote: >really thx for your response but it's still doesn't work, if I try to do a >simple echo $insert; >I get this error message : 0 Erreurr SQL !0 > >I can't understand, how do you debug your query ? > >thx in advance > >"Roy W. Andersen" <roy-news@netgoth.org> wrote: >>Alexandre wrote: >>> >>> "'/avatard/.$nom_utilisateur','$no_telephone', '1'"); >>> >> >>Your closing bracket is placed after the end quote of the string. >> >>Your current statement reads $insert = "string"); which doesn't work >>very well ;) >> >> >>Roy W. Andersen >>-- >>ra at broadpark dot no / http://roy.netgoth.org/ >> >>"Hey! What kind of party is this? There's no booze >>and only one hooker!" - Bender, Futurama > |
|
|||
|
Alexandre wrote:
> I'm really going crazy with this query : > > $insert = "INSERT INTO utilisateur(nom_utilisateur,mot_de_passe,prenom, " + 111111111111111 222222222222 333333 > "nom,date_de_naissance,site_internet, " + 444 55555555555555555 6666666666666 > "avatard,no_telephone,statut) VALUES " + 7777777 888888888888 999999 It appears that you are inserting into nine columns, but ... > "('$nom_utilisateur','$mot_de_passe','$prenom' , " + 111111111111111111 222222222222222 333333333 > "'$nom,$date_de_naissance', " + 4444444444444444444444444 > "'$site_internet', " + 5555555555555555 > "'/avatard/.$nom_utilisateur','$no_telephone', '1'"); 6666666666666666666666666666 777777777777777 888 you only have eight columns specified in the VALUES group. There are two more thing wrong here: a) (I´m not sure if this is wrong or is really what you want) You have "'/avatard'.$nom_utilisateur',..." When $nom_utilisateur is "Pedro" this will create "/avatard/.Pedro" b) As other posters have said, your closing parentheses is outside the string You have $insert = "whatever"); which should be $insert = "whatever"; -- Mail to my "From:" address is readable by all at http://www.dodgeit.com/ == ** ## !! ------------------------------------------------ !! ## ** == TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>) may bypass my spam filter. If it does, I may reply from another address! |