List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:August 3 1999 4:13pm
Subject:Re: Sorting
View as plain text  
Jody wrote:
> 
> OK I added that "ORDER BY" and had another look at the manual...
> 
> but now im getting an error on line 15
> 
> $result=mysql_query("SELECT * FROM Items WHERE Category='$CA' ORDER BY '$IN'
> ASCENDING");
< cut >

The part after ORDER BY has to be a column number or a column name not a variable.
If you don't know the column name for the second column, just use:
"SELECT * FROM Items WHERE Category='$CA' ORDER BY 2 ASC"

Tschau
Christian

Thread
SV: SortingMartin Edelius3 Aug
  • Re: SortingJody3 Aug
  • Re: SortingChristian Mack3 Aug