marcus Posted October 16, 2006 Share Posted October 16, 2006 what would be a good way to start out a ranking system? Link to comment https://forums.phpfreaks.com/topic/24158-ranking-system/ Share on other sites More sharing options...
Barand Posted October 17, 2006 Share Posted October 17, 2006 Supposing you have a table "item" containing items to be rateditem--------item_iditem_nameCreatea second table to store your users rating scoresrating-----------iditem_id // id of the item being ratedscoreuser_id // optional - use if users must login and can only vote onceTo get the top 10 rankingsSELECT i.item_name, AVG(r.score) as avscoreFROM item iINNER JOIN rating r ON i.item_id = r.item_idORDER BY avscore DESCLIMIT 10 Link to comment https://forums.phpfreaks.com/topic/24158-ranking-system/#findComment-110308 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.