sorting a SQL result set
Hi, I'm sure somebody has done this before and knows the answer :-) A user can search a MySQL database using an extensive form of over 30 fields. The result is displayed in a 5 col list with column headings. I want to be able to allow sorting (asc and desc) on these columns. To sort on any column the query has to be executed again with the relevant order clause. As there can be over 30 fields in the original query what would be the best way to save and then restore the query? Does it make sense to try and load the result into a list object before displaying and from then on work with the list object when sorting? I hope the above makes sense. Any help greatly appreciated. Hwyl, Sion
Sion Morris writes:
As there can be over 30 fields in the original query what would be the best way to save and then restore the query? A session object, e.g. FSSession or CoreSessionTracking or ...
Does it make sense to try and load the result into a list object before displaying and from then on work with the list object when sorting? You can do this as well. Usually, one would expect that the database sorts faster.
Dieter
participants (2)
-
Dieter Maurer -
Sion Morris