April 1st, 2009, 07:53 PM #1
- Join Date
- Apr 2009
How can I sort by column headings in php mysql?
I set up a results page which shows me results from my query...
$query_WADAproperties = "SELECT id, pic, address, city, state, submarket, type, class, year, buildingsize, floorsize, space, broker, annualrent FROM properties ORDER BY id ASC";
How would I set up the ORDER BY to be a variable so when I click on a column heading it passes the variable to the php and re-sorts it?
I would think that I need to declare a variable that defaults to "id" if nothing is passed to it and put it somewhere in the php.... and make the headings clickable, pointing back to the results.php with a parameter, but have no idea how.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By unwanted in forum Webmastering and ProgrammingReplies: 18Last Post: July 10th, 2007, 10:10 PM
By EXreaction in forum Webmastering and ProgrammingReplies: 6Last Post: February 13th, 2006, 01:00 AM
By VillageIdiot906 in forum Webmastering and ProgrammingReplies: 3Last Post: February 22nd, 2005, 11:54 PM
By VillageIdiot906 in forum Webmastering and ProgrammingReplies: 2Last Post: February 22nd, 2005, 09:15 PM
By jomoal99 in forum Webmastering and ProgrammingReplies: 2Last Post: August 16th, 2004, 05:48 AM