View Single Post
  #2 (permalink)  
Old Nov 21st, 2007, 04:47
c010depunkk's Avatar
c010depunkk c010depunkk is offline
SuperMember

SuperMember
Join Date: Apr 2007
Location: Willich, Germany
Age: 20
Posts: 593
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: PHP/MySQL Sorted Output

I would let MySQL to the sorting and then just output what the query returns:
PHP: Select all

$sort_key=mysql_escape_string($_GET['order']);
$query=mysql_query("SELECT * FROM files WHERE pos = '1' ORDER BY $sort_key;");
while(
$row=mysql_fetch_object($query)) {
   
// output

See if you can do something with that...