473,385 Members | 1,740 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

interactivel sorting mysql tables

From a html file I have something like this:

<a href="showtable.php?table=clients&col=lastname"><b >Mysql
Table</b></a>

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.

thanks,
Roger
Jul 17 '05 #1
1 5981
While the city slept, Roger Lord (rl********@yahoo.com) feverishly typed...
From a html file I have something like this:

<a href="showtable.php?table=clients&col=lastname"><b >Mysql
Table</b></a>

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.

thanks,
Roger


Wouldn't the following work?

<a href="showtable.php?table=clients&col=firstname">S ort by first
name</a>
<a href="showtable.php?table=clients&col=lastname">So rt 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
colour</a>

SELECT * FROM $table ORDER BY $col

Cheers,
Nige

--
Nigel Moss
http://www.nigenet.org.uk
Mail address not valid. ni***@DOG.nigenet.org.uk, take the DOG. out!
In the land of the blind, the one-eyed man is very, very busy!
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Zaphod Beeblebrox | last post by:
As much of this question relates to mysql, it may be OT? I'm trying to make a search engine for a reasonably complex database that was originally developed by someone else in Access. I've ported...
13
by: Paul | last post by:
Hi all I have a sorting problem, but my experience with Python is rather limited (3 days), so I am running this by the list first. I have a large database of 15GB, consisting of 10^8 entries...
0
by: Stefan Hinz | last post by:
Jim, >> Does MySQL automatically handle deleted row cleanup, or is it necessary to >> periodically do this manually for tables with a lot of deletions? If it's >> manual, what are the SQL...
8
by: Greg | last post by:
Hello, I've to manage many 'table' (having same scheme) on the same server. And I ask myself what could be the best to do (and if you know, why) : Creating as many database (the name would...
4
by: Paul Marcel | last post by:
I'm new to databases and am experimenting with mysql. I have a clients table and a sales table in a mysql database. Client_id is the primary key in clients and a secondary key in sales. The...
1
by: leegold | last post by:
Given the SQL shouldn't the records be sorting by score ie. relevance? I thought if "WHERE MATCH" is used it will sort that way. Thanks mysql> SELECT `page`.`title` , MATCH ( `title` , `descrip`...
57
by: Bing Wu | last post by:
Hi all, I am running a database containing large datasets: frames: 20 thousand rows, coordinates: 170 million row. The database has been implemented with: IBM DB2 v8.1
3
by: 2401 members, members can post | last post by:
Dear Madams and Sirs, Ever had to split a website + SQL Tables ? Have a UNIX pc-linux-gnu on i686 + FEDORA 1) We have to split a sub-domain for the main domain name. 2) We have to build a...
2
by: amit2781 | last post by:
Hi, I have created 4 tables in 'amit' database and then I deleted them. Still I able to get information about the table_schema for the table deleted. After drop table when I fire a query for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.