I'm looking for an easy way to sort results from a MySql query - can anyone help?
I can do an initial sort in the query statement itself, but what I want to be able to do is when the results are displayed (e.g. name, region, country) I want to give the user the option to order the results (by either name, region, or country). Obviously one way is to re-query the database, but this is very inefficient since we already have the results.
I was looking into using a multidimensional array, put cannot get my head around how the sort might work.
Any ideas?
Thanks,
James
I can do an initial sort in the query statement itself, but what I want to be able to do is when the results are displayed (e.g. name, region, country) I want to give the user the option to order the results (by either name, region, or country). Obviously one way is to re-query the database, but this is very inefficient since we already have the results.
I was looking into using a multidimensional array, put cannot get my head around how the sort might work.
Any ideas?
Thanks,
James