tail Posted January 21, 2010 Share Posted January 21, 2010 I'm working on a script that shows game compiled in a MySQL database. I'm trying to sort them 3 different ways: newest, most popular, and highest rated. The first two are easy because they are in the same table as the game information. However, the ratings are stored in a different table. I think this is possible to do using a join, but I don't know how to do that. The tables are set up as follows: table `info` | id | user_id | name | desc | category | plays | date_added | table `rating` | game_id | user_id | rating_value | Is it possible to add up the rating values, then divide that by the number of ratings for the specific id, then sort the result by the highest rated game? Link to comment https://forums.phpfreaks.com/topic/189245-sort-mysql-result-by-a-different-tables-values/ Share on other sites More sharing options...
tail Posted January 22, 2010 Author Share Posted January 22, 2010 Bump! Link to comment https://forums.phpfreaks.com/topic/189245-sort-mysql-result-by-a-different-tables-values/#findComment-999750 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.