Page 1 of 1

order by

Posted: Mon Jan 17, 2005 11:21 am
by SidewinderX
ok i believe this will be my last question and i will finally be done with my project!!! WOOT!!! :lol:

anyway...i have a table, and when you click on one of the table headings for instance "Player" i want it to ORDER BY player or "levels" i want it to display who has the most levels first in decending order or vice versa...i know i can do that in the sql query by ORDER BY... but how can i make a link do that?

Posted: Mon Jan 17, 2005 11:36 am
by feyd
as I've suggested before on this topic: pass the column to sort by (and DESC/ASC info) through the url.

Posted: Mon Jan 17, 2005 7:07 pm
by protokol
An example would be this type of link:

Code: Select all

<a href="person.php?sort=age&order=desc">Sort By Age, Descending</a>