Learn how to apply the sorting functionality to the table columns, where by clicking on the column heading the order of the items changes from ascending to descending and vice versa. We will accomplish this using PHP, Session Variables and some Ajax calls via jQuery.
PHP / MySQL Tutorial
Time: 15:45 min / Price: £0.00
Sebastian Sulinski on 25th Aug 2011





Lars Inge Holen on Tuesday, 30th August 2011
Great Sebastian, you Rock !!
What if this table should be printed, what is the easiest way of doing that.
Reply
Sebastian Sulinski : @designtutorials on Tuesday, 30th August 2011
Hi Lars,
Thanks for the comment - you've just given me a good idea for the today's tutorial - check the site later today.
Reply
nelson on Monday, 13th August 2012
i have some problem to try on your code, i got error
"Fatal error: Call to a member function fetchAll() on a non-object in C:\xampp\htdocs\test\sort\index.php on line 22"
i only change the user name and passowrd to my server user and password.
Reply
Sebastian Sulinski : @designtutorials on Monday, 13th August 2012
Hi Nelson,
It looks like you're calling fetchAll() method on a non-object - this is most likely due to the $statement returning empty result. Try to replace:
with:
$result = null; if ($statement) { $result = $statement->fetchAll(PDO::FETCH_ASSOC); }Reply
nelson on Monday, 13th August 2012
it's work now.. thanks
Reply