Jump to content

[SOLVED] Average Ratings From DB


DrDankWD

Recommended Posts

Hello, I need a bit of help making an average from multiple ratings.

 

There are two DB tables, one is "venues" the other is "ratings"  the "venues_id" field in the "ratings" table matches up with the "venues_id" field in the "venues" table. 

 

The "ratings" table had three different values for different aspects of the rating: "food", "service", "ambience". Each one of the three rating parts is a number 1-5.

 

What I need to do is get an average rating for each venue.

 

If this doesn't make any sense please let me know, I will try harder to explain it.

 

Thanks In Advance,

DrDankWD

Link to comment
Share on other sites

 

  $myString = "SELECT food,service,ambience FROM venues y

                INNER JOIN ratings x ON y.venues_id=x.ratings";

 

that for the joining i dont understand much of the question so i gues i do it this way

 

heres to get the average

AVG(values here)

 

then maybe you will need the group by and/or distinct

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.