9 replies
Change this query:

SELECT DISTINCT Skill FROM ratings WHERE User='$F'

to order by the count of each distinct value

For example if Skill returns the followng distinct values 2 - 5 - 7
and in the table there are (5)2's - (3)5's - (10)7's

the return order would be 7 - 2 - 5
#msql #query

Trending Topics