Jump to content

Ratings On Stuff


Guest FirefoxRocks
 Share

Recommended Posts

Guest FirefoxRocks

I was wondering how sites store ratings on things. For example: people rate YouTube videos, does YouTube have a database containing the user ID, video ID and rating? For Facebook it is as simple as liking something (maybe dislike soon, not sure yet though), there is only 1 rating. Same with forum topics like this one, does the database have a rating table to store this.It's a many to many relationship so I'm wondering if this would be the correct method to implement such a system. And if you have more than 1 rating (e.g. rating a product on Price, Durability and Ease of Use) then each one would be in a separate field I assume?

Link to comment
Share on other sites

Yes. Something like

+-----------+	 +---------+| Items	 |	 | Ratings |	 +-----------++-----------+	 |+--------+	 | Users	 || ID		|-----| Item ID |	 +-----------+| Name etc. |	 | User ID |-----| ID		|+-----------+	 | Rating1 |	 | Name etc. |				  | Rating2 |	 +-----------+				  +---------+

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...