Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-26-2003, 12:08 PM
|
#1
|
Member
Registered: Jul 2003
Distribution: Red Hat
Posts: 94
Rep:
|
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
|
|
|
07-26-2003, 12:15 PM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
order is a reserved word. change it to "orders" or something similar
|
|
|
07-26-2003, 02:36 PM
|
#3
|
Member
Registered: Jul 2003
Distribution: Red Hat
Posts: 94
Original Poster
Rep:
|
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 :\
|
|
|
07-26-2003, 04:34 PM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
a simple look at the mysql manual says:
ALTER name RENAME [TO] newname
|
|
|
07-27-2003, 02:18 AM
|
#5
|
Member
Registered: Jul 2003
Distribution: Red Hat
Posts: 94
Original Poster
Rep:
|
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 []
|
|
|
07-27-2003, 03:05 AM
|
#6
|
Member
Registered: Jul 2003
Location: Surabaya - East Java, Indonesia
Distribution: Red Hat, Mandrake, Debian, Knoppix
Posts: 57
Rep:
|
Try using backquotes (`) for table name...
|
|
|
07-27-2003, 03:08 PM
|
#7
|
Member
Registered: Jul 2003
Distribution: Red Hat
Posts: 94
Original Poster
Rep:
|
Thanks a lot!
[][]
|
|
|
All times are GMT -5. The time now is 10:16 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|