marcus Posted October 16, 2006 Share Posted October 16, 2006 what would be a good way to start out a ranking system? Quote Link to comment 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 Quote Link to comment 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.