Hello,
I have a site with songs that are rated from 1-10 such as
6.57, 9.02, 7.75.
I would like to setup a statement where I determine the songs ranking compared to the others such as:
This song is ranked #155 out of 4009 items.
I can use this to find the total song count:
$getGenSongCount = "SELECT COUNT(*) AS count FROM songs WHERE sgenre = '$sgenre'";
$rs5 = mysql_query($getSongCount, $conn);
$songCount = mysql_result($rs5, 0);
in the "songs" table there is a column called srating. I think I need to do something like:
Select * from songs ORDER BY srating DESC
but am still uncertain how to determine its Ranking compared to the other songs.
Thanks for any help. 🙂