Author Topic: Another PHP question....  (Read 3125 times)

Canuck

  • Eh?!!
  • Founders
  • Posts: 792
  • Karma: +51/-3
  • Andy Moog Fan
    • My Website
Another PHP question....
« on: February 28, 2006, 05:31:53 PM »
I have a page which displays all my results from the db, and when I select the column heading of any of the rows it is sorted in the opposite manner in which it is currently listed.  I pass two paramaters in the URL, the order in which to sort and the column name.

I have a section (different php file than the above) where there are drop downs and radio buttons in which users can perform certain queries.  I currently have radio buttons which can be selected to display the results in ascending and descending order.

I wanted to implement the same sorting feature I had when I viewed all the results, the problem is when I select the row, I would have to call the query which was just performed and adding a variable to it to sort it in ascending and descending order.

I submit the results with a form, and the form on the page calls itself.

How do I keep track of the last query performed so that I know how to sort the data?

Thanks

edit:  I was looking at the memberlist to see how it sorts, and it does it by sending all the variables in the URL, would that be the best way?
« Last Edit: February 28, 2006, 05:53:50 PM by Canuck »

Mike

  • Jackass In Charge
  • Posts: 11257
  • Karma: +168/-32
  • Ex Asshole - a better and more caring person.
Another PHP question....
« Reply #1 on: February 28, 2006, 07:48:32 PM »
Most likely it'll just be easier to run the query again.  Especially if you use any type of LIMIT.  You could store it in a session but storting it will probably take just as long or longer then running the query again.