LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   mysql error (https://www.linuxquestions.org/questions/linux-software-2/mysql-error-76115/)

nullpt 07-26-2003 12:08 PM

mysql error
 
Hi there folks,

I'm getting some error with this line and i can't find what is rong:

mysql_query("INSERT INTO order (name, addr, country, clan, chan, email) VALUES ('$name', '$addr', '$country', '$clan', '$chan', '$email')") or die("Couldn't connect!" . mysql_error());

The vars exist and have values.

It's giving me this error:

You have an error in your SQL syntax near 'order (name, addr, country, clan, chan, email) VALUES ('alex', 'lol', 'lo', 'lo'' at line 1

Thanks in advance

acid_kewpie 07-26-2003 12:15 PM

order is a reserved word. change it to "orders" or something similar

nullpt 07-26-2003 02:36 PM

Thanks a lot mate.

btw, how can i change the table name?

I have a lot of work there and i dont want to waste it :\

acid_kewpie 07-26-2003 04:34 PM

a simple look at the mysql manual says:

ALTER name RENAME [TO] newname

nullpt 07-27-2003 02:18 AM

Thanks a lot mate, but i can't do that due to the reserved word... if I place ORDER in the SQL the database assumes ORDER as the reserved name of SQL and not as a table name

Thamks anyway mate []

danny_kurniawan 07-27-2003 03:05 AM

Try using backquotes (`) for table name...

nullpt 07-27-2003 03:08 PM

Thanks a lot!

[][]


All times are GMT -5. The time now is 01:53 PM.