EchoFool Posted June 16, 2009 Share Posted June 16, 2009 I have a ranking system im building where users can vote for something from 1 to 5. The problem is say one person votes 5 out of 5 .. this beats a listing which has like 20 votes of 5 out of 5s and 4 out of 5s which happen to average 4 out of 5 over all.. but the single 5 out of 5 averages trumps obviously. How would you go about something like this to also take into account how many people voted ? Quote Link to comment https://forums.phpfreaks.com/topic/162481-average-listing/ Share on other sites More sharing options...
Maq Posted June 16, 2009 Share Posted June 16, 2009 I'm going to go ahead and assume this is in a database since you never specified. You can use the aggregate AVG() function to extrapolate the desired results. Quote Link to comment https://forums.phpfreaks.com/topic/162481-average-listing/#findComment-857589 Share on other sites More sharing options...
EchoFool Posted June 16, 2009 Author Share Posted June 16, 2009 Well i used AVG() in a query But 100 votes of 4s and 5s which averaged overall a 4 when ORDER BY DESC it was lower than a listing with only one vote of 5 which averaged overall of 5... which seemed a bit inaccurate? Quote Link to comment https://forums.phpfreaks.com/topic/162481-average-listing/#findComment-857592 Share on other sites More sharing options...
htzone Posted June 17, 2009 Share Posted June 17, 2009 Sites like IMDB require a minimum amount of votes before their ratings are displayed, which is how they deal with this problem. You could just set the rating to only display once you hit five or ten votes. Quote Link to comment https://forums.phpfreaks.com/topic/162481-average-listing/#findComment-857704 Share on other sites More sharing options...
Ken2k7 Posted June 17, 2009 Share Posted June 17, 2009 Then your query is wrong. What else can I say? Quote Link to comment https://forums.phpfreaks.com/topic/162481-average-listing/#findComment-857734 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.