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?