Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- interactivel sorting mysql tables
- Roger Lord
August 26, 2004, 12:02 am
rate this thread
This is a general mysql table viewer for a database.
showtable.php displays the table in a browser fine. It uses the
'clients' table and sorts it by 'lastname' passed in on the command
line. The sorting is done by "order by". So far, so good.
Now I'd like to have some buttons at the top of each column to cause
the table to redisplay sorted by the column that the user clicks on.
Is this possible?
Basically I need to re-call showtable.php with different valuse for
the col parameter.
Does anyone know how I can allow the user to interactives sort columns
this way? Like a window listview control.
Re: interactivel sorting mysql tables
Wouldn't the following work?
<a href="showtable.php?table=clients&col=firstname">Sort by first
<a href="showtable.php?table=clients&col=lastname">Sort by last name</a>
<a href="showtable.php?table=clients&col=age">Sort by age</a>
<a href="showtable.php?table=clients&col=haircolour">Sort by hair
SELECT * FROM $table ORDER BY $col
Mail address not valid. nigel@DOG.nigenet.org.uk, take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!
- » 1/2[OT]: download just the required code of 'escapeshellarg()' functionfrom cvs
- — Next thread in » PHP Scripting Forum