Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.
Moderator: General Moderators
-
Skara
- Forum Regular
- Posts: 703
- Joined: Sat Mar 12, 2005 7:13 pm
- Location: US
Post
by Skara »
All it says is a syntax error.
Code: Select all
SELECT * FROM books_list WHERE author='{$_GETї'author']}' ORDER BY order
Don't get it, as I have basically the same thing in another one and it works fine:
Code: Select all
SELECT * FROM books_authors ORDER BY name
I know it's something stupid.

What am I doing wrong?
-
protokol
- Forum Contributor
- Posts: 353
- Joined: Fri Jun 21, 2002 7:00 pm
- Location: Cleveland, OH
-
Contact:
Post
by protokol »
Show us the entire line of PHP code. Then we can help you.
-
Wayne
- Forum Contributor
- Posts: 339
- Joined: Wed Jun 05, 2002 10:59 am
Post
by Wayne »
I think you will find that order is a reserved word.
-
JayBird
- Admin
- Posts: 4524
- Joined: Wed Aug 13, 2003 7:02 am
- Location: York, UK
-
Contact:
Post
by JayBird »
As wayne says, order is a reserved word
You should change the name of your "order" column to "order_number" or something
-
andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
Post
by andre_c »
... or wrap it in backticks:
-
Skara
- Forum Regular
- Posts: 703
- Joined: Sat Mar 12, 2005 7:13 pm
- Location: US
Post
by Skara »
aHAH!! Well, didn't even think about that for some reason! ^^; Probably because I'm so bashed from finals week.
