This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » PHP » Search Query and Sort Query
Reply

Search Query and Sort Query

Heather V
Freaking Member



Since: 30 May 2007
Posts: 61
Posted 10 Jan 2010 02:47:49

How may I be able to:

#1 Create a Sort from a Query with a series of Headings


#2 Create a Search box and code to Search within a query of results?

How may I be able to:

#1 Create a Sort from a Query with a series of Headings


#2 Create a Search box and code to Search within a query of results?
Alan C
Total freaking Member



Since: 04 May 2006
Posts: 473
Replied 15 Jan 2010 19:08:33
#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.

Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency