Hey guys,
I've inquired about this before, with no luck. I've tried this on my own before, with no luck. What I am trying to do is setup a page that lists items in the database and the table headers are links that sort the table by that column.
For example, on the page books.php I have this table:
Book Name | Book Author | Book Release Date | Book Genre
By default the results from the table 'books' are sorted by Book Release Date (book_release_date) DESC.
When someone clicks on 'Book Name' at the top of the table I'd like for it to reload the page with the SAME results sorted by the book name.
If my query is:
$query = "SELECT * FROM books WHERE book_active=1 ORDER BY book_release_date DESC";
How do I get it to reload the page and read a different query? Can I have multiple queries on each page? If so, how does the PHP/mySQL know which one should be used when.
Thanks for any help!