I have a MySQL query I'm trying to sort dynamically when a link is clicked.
My link looks like this
<form action="topics.php" method="get" class="form">
<label class="label">Order Table By</label>
<li><a href="topics.php?sort=ID">ID</a></li>
<li><a href="topics.php?sort=Title">Title</a></li>
<li><a href="topics.php?sort=TAGS">Tags</a></li>
<li><a href="topics.php?sort=VIEWS">Views</a></li>
</form>
MySQL Query looks like this:
<?php
$order = mysql_real_escape_string($_GET['sort']);
$topics = mysql_query("SELECT topic_id AS 'ID', topic_head AS 'Title',
topic_tags AS 'TAGS', topic_views AS 'VIEWS',
FROM forum_topics
WHERE topic_id > 0 ORDER BY '$order' DESC") or die (mysql_error());
When I click any of the links above nothing happens. No error is shown, no sorting is done. Where could the problem be ? Thanks