Forums
This topic is locked
Search Query and Sort Query
Replies
Replied 15 Jan 2010 19:08:33
15 Jan 2010 19:08:33 Alan C replied:
#1
not sure just what you meant, but I think it's a page that has columns of results and clicking on the heading sorts by that column either ascending or descending.
Couple of ways to tackle this, one is to have a separate select and sort coded up for each column, then link to each of those scripts from the table headings - messy and will need a lot of maintenance in the future.
Better - make the headings into links that have url parameters added to the url of the current page, then when it's reactivated look at the parameter that is passed in and use it to modify a select/sort query, and don't forget to do some verification of the parameter before anything else to prevent attacks.
You can toggle the sort direction with this too.
not sure just what you meant, but I think it's a page that has columns of results and clicking on the heading sorts by that column either ascending or descending.
Couple of ways to tackle this, one is to have a separate select and sort coded up for each column, then link to each of those scripts from the table headings - messy and will need a lot of maintenance in the future.
Better - make the headings into links that have url parameters added to the url of the current page, then when it's reactivated look at the parameter that is passed in and use it to modify a select/sort query, and don't forget to do some verification of the parameter before anything else to prevent attacks.
You can toggle the sort direction with this too.