Hello,
I'm using the code below to count records in a particular field & display them in a particular manner. The code is working fine. However, I want the results to be sorted descending according to count and not according to keyword. How do I do that? Thanks a lot for your help.
$query1="SELECT keyword, COUNT(keyword) AS count FROM houses_log GROUP BY 'keyword' DESC";
$result1=mysql_query($query1);
$num1=mysql_numrows($result1);
while ($row1 = mysql_fetch_assoc($result1))
{
echo "<strong>".$row1['keyword'] . ' - ' . $row1['count'] . ' records<br></strong>';
}