View Single Post
  #3 (permalink)  
Old Dec 5th, 2006, 16:34
NewDesigner NewDesigner is offline
Junior Member
Join Date: Aug 2006
Location: Leeds
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Sorting A Table By Column Header

Thanks for the info.

I have managed to sort the columns by ascending through using:

$order = $_GET["order"];
if (!$order=="")
{
$query = $query." order by $order ";
}

if (mysql_num_rows($result) > 0) {
echo "<table cellpadding=10 border=1>";
echo "<tr><td><a href='products.php?order=Name&letter=$initialLette r'>Name</a></td>".

I used this as I could not find the information in phpMyAdmin.
Is there a way in which I can adapt this coding to make it do both ascending & descending?

Thanks again.
Reply With Quote