If you want to etc have sort=1d as name DESC you can use something like this insted
PHP Code:
<ul>
<li onClick="location.href='searchpage.php?sort=1d';">Sort by name desc</li>
<li onClick="location.href='searchpage.php?sort=2d';">Sort by id desc</li>
</ul>
PHP Code:
<?php
$sort = $_GET['sort'];
if($sort == "1d"){
$sort_option = "ORDER BY name DESC";
}
elseif($sort == "2d"){
$sort_option = "ORDER BY id DESC";
}
$search_query = mysql_query("SELECT * FROM `$mysql_database`.`sometable` WHERE id!='' $sort_option");
while($out = mysql_fetch_object($search_query)){
echo "$out->name $out->id";
}
?>
Maybe that was better?
Still dont really know what you want 
But might give you an idea?
Kris
Bookmarks