Problem with ORDER BY col_name LIMIT 0,15
Posted: Sun Dec 15, 2002 12:39 am
So I've been working on this database, blah blah.
$start_pos = 0, $num_links = 15, $order_by = "added"
My SQL:
"added" is a column name.
Error: "You have an error in your SQL syntax near ' ORDER BY ' at line 1"
When I switch the "LIMIT $start_pos,$num_links" and the "ORDER BY $order_by", I get the error: "You have an error in your SQL syntax near 'LIMIT ,' at line 1"
Any help?
$start_pos = 0, $num_links = 15, $order_by = "added"
My SQL:
Code: Select all
SELECT * FROM `aref_users` LIMIT $start_pos,$num_links ORDER BY $order_byError: "You have an error in your SQL syntax near ' ORDER BY ' at line 1"
When I switch the "LIMIT $start_pos,$num_links" and the "ORDER BY $order_by", I get the error: "You have an error in your SQL syntax near 'LIMIT ,' at line 1"
Any help?