Hi Friends, I am looking for a solution for the following problem: I need display a table with say 10 columns. When the user clicks on any column name, the whole table need to be SORTED based on coulumn selected. Is there any way I can do it locally ( I mean that i don't need to go to server for fetching the data as what all i need to do is to just display the existing data in some other order). Any help is highly appreciated.. Thanks a lot for viewing the issue. Regards,
PHP would work for server side. For a local solution, go with javascript Examples & code: http://www.kryogenix.org/code/browser/sorttable/
If the data is same than this can be done using javascript. Use arrays to store the value, and than use for loops and simple comparison operators to sort the values. If the values are dynamic than u have to use PHP + mysql.
I have seen a good ajax implementation of this which uses php/sql to sort the data without reloading the page.
go with mysql query ORDER, javascript might pose some problems on some browsers; however, you can't really do it without querying the server