For what it's worth, any use of the aggregate function in the select list means that there will only be one row in the result set. It doesn't make sense to sort the result set with one row.
If you want to get the number of ratings for different prof values, you should use this:
$order_list = mysql_query(" SELECT prof, COUNT(*) AS PROFCOUNT, FROM prof_rating GROUP BY prof ORDER BY PROFCOUNT ASC'");
This will result in multiple rows, one row per value, with the number of rows for each given value.
Bill karwin
source share