Page 1 of 1

ORDER BY

Posted: Sat Sep 13, 2003 3:23 am
by Zeceer
I've read the other post here about ORDER BY by it didn't help me much. I've also tried to look for code examples without any luck. Is there something wrong wih the syntax in this code?

Code: Select all

$result = mysql_query( "SELECT * FROM products ORDER BY products DESC" );
Later in the script the $result variable is being used like this:

Code: Select all

while ($row = mysql_fetch_assoc($result))
The script works fine if I remove the ORDER BY products DESC in the $result variable. Like this:

Code: Select all

$result = mysql_query( "SELECT * FROM products" );

Posted: Sat Sep 13, 2003 3:36 am
by Zeceer
I found it out :oops: Problem solved

Posted: Sat Sep 13, 2003 3:37 am
by JAM
Just to make sure, do you have a field in you 'products' table that is named 'products'?

Ie. can you do this:

Code: Select all

$result = mysql_query( "SELECT products FROM products ORDER BY products DESC" );