I'm trying to determine what would be the most efficient/recommended way of doing this--I have a table consisting of MySQL table elements that are generated by PHP upon page load. There are four columns, but right now I'm concentrating on sorting them by date added-if the user clicks the column header link "Date".
So my options are either using AJAX w/ PHP to contact the database, sort the entries by date, generate the table code and send it back to replace the table in real time. Or, I could use JQuery to build an array of the rows and determine the order based on the date (which will be a little bit of work because the dates are formatted like 'January 16, 2012') and then resort the rows accordingly.
Which of these options, or if you have a better idea for working this, would you recommend to use?
Thanks!