Jump to content

[SOLVED] Sorting table results


soycharliente

Recommended Posts

That is a little bit trickier. I don't have my code here, but the way I did it (if I remember correctly) was with a GET variable that told whether it was asc or desc. To dynamically change the query, all you have to do is something like this:

$query = "SELECT * FROM table";
if ($_GET['var'] == "asc")
   $query .= " ORDER BY DESC";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.