i am using the following to count the records within groups, is there an easier way using COUNT ?? therefore enabling me to order the results
$result=mysql_query("SELECT Keyword, FROM dir_keywords GROUP by Keyword ORDER by Keyword ASC");
$list = mysql_num_rows($result);
while ($i < $list) {
$row = mysql_fetch_array($result);
$key = $row["Keyword"];
$resulta= mysql_query ("SELECT * FROM dir_keywords WHERE Keyword='$key'");
$count = mysql_num_rows($resulta);
print"$key";
print"$count";
$i++;
}
The above will print the following :-
apple 1
bannana 5
orange 2
strawberry 7
I would like them to be ordered by highest number.
Any ideas to make it easier than having two calls to the db ??
Darren Ramowski