good day can anyone help me with my sort by? nothing happens when clicking the sort no errors tried the codes 4 years ago don't know if it's still usable the sql.= i think don't work or my other query just disables it. here's my sql command thanks :D. help with the order by.
//table
<table>
<tr>
<th>
<a href="?orderBy=date">Type:</a>
</th>
<th>
<a href="?orderBy=FirstName">Description:</a>
</th>
<th>
<a href="?orderBy=Lastname">Recorded Date:</a>
</th>
<th>
<a href="?orderBy=Date">Added Date:</a>
</th>
</tr>
</table>
and here's my php code same page with the links
<?php
$sort=$_GET['orderBy'];
$query=mysql_query("select * from persons order by '$sort' desc LIMIT $start,$per_page ");
$count=mysql_query("select * from persons where firstname like '%$searchtext%' or lastname like ' %$searchtext%' order by '$sort'");
$numrows = mysql_num_rows($count);
sort don't work outputs nothing example public_search.php?orderBy=FirstName
update when i use the query of :
select * from persons where firstname like '%$searchtext%' or lastname like '%$searchtext%' ORDER BY status DESC LIMIT $start,$per_page
it works so i conclude that it don't get the sort command