phpbar.de logo

Mailinglisten-Archive

[php] How to sort data records in a table by their fields?

[php] How to sort data records in a table by their fields?

Jörg Klinge php_(at)_phpcenter.de
Mon, 25 Jun 2001 13:09:12 +0100


Hello Ralf,

Gac> Hello,

Gac> I have a table in html with the following fields: ‚name' ‚price' ‚first 
Gac> contact'. This table is a result of a mysql database query (over a 
Gac> php-script). This table in html has a lot of data records. Now I want to 
Gac> sort/ classify this data records by their name or price or first contact. I 
Gac> know that there exist a solution with the javascript language, there is a 
Gac> sort-button where you can choose between the different classification 
Gac> possibilities, ‚name', price or first contact. Anybody knows a solution?

Gac> Thanks in advance

Try this:

$result = mysql_query ("SELECT * FROM guestbook WHERE sichtbar='1' ORDER BY datum desc")

or

$result = mysql_query ("SELECT * FROM xxx ORDER BY neu desc, geaendert desc, stadt ")



best regards / mit freundlichen Gruessen,

Joerg Klinge

--
Internet Central Exchange - Hostmaster Dep.
mailto: hostmaster_(at)_cix.cx - http://www.i.cx



php::bar PHP Wiki   -   Listenarchive