I don't think this is possible but there's got to be a way to do it. I have a table with categories and productnames where there is one product name to many categories. So far I was doing:
$CatQuery = "SELECT DISTINCT categoryname FROM $ProductsTable ORDER BY categoryname DESC";
$CatResult = mysql_query($CatQuery) or die(mysql_error().'<br />');
while ($Row = mysql_fetch_assoc($CatResult))
{}
but that doesn't work when I do
$CatQuery = "SELECT DISTINCT categoryname FROM tblproducts ORDER BY COUNT(productname) DESC";
$CatResult = mysql_query($CatQuery) or die(mysql_error().'<br />');
while ($Row = mysql_fetch_assoc($CatResult))
{}