i know it sounds kinda confusing, i tried to eliminate a few factors to see if it would make more sense but let me see if i can explain it better...
name | song | 5s | 4s | 3s | 2s | 1s
john | song1 | 5 | 4 | 6 | 3 | 2
mark | song1 | 4 | 4 | 5 | 0 | 1
alex | song1 | 1 | 6 | 3 | 7 | 6
john | song2 | 5 | 4 | 0 | 3 | 4
alex | song2 | 5 | 8 | 3 | 2 | 1
john | song3 | 3 | 5 | 6 | 9 | 0
...each person has a song which was rated 1-5. the columns 5s, 4s, 3s, 2s, & 1s are the ratings. the numbers in those columns represent the number of times that particular song received that rating...alex's song 1 received 1 "5" rating, 6 "4" ratings, 3 "3" ratings and so on. The variable i created above ($avgformula ) will determine the average rating for a particular song but i'm tryng to figure out how to find the person who has the most songs with an average rating greater than 4.
ive tried...
$avg4orbetter = mysql_query ("SELECT rap_name, $avgformula FROM tracks GROUP BY rap_name ORDER BY $avgformula DESC LIMIT 1") or die(mysql_error());
list ( $avg4orbetter ) = mysql_fetch_row ( $avg4orbetter ) or die (mysql_error());
...its not giving me an error from the "(mysql_error());" its just not returnng the right answer. i guess a stepping stone would be to first write the code that finds the artist with the most songs in general the maybe add "where $avg4orbetter='True'" or something like that but the coding i attempted with that didnt work either.
i hope that explains it better, if not let me know and i'll try to explain it in further detail. thanks for the help.