Jump to content

rating script


jonniejoejonson

Recommended Posts

A site like youTube that allows you to add ratings to videos... What I would like to know is...

Do you

 

Store in a database the 'ratersId' the 'rating' and the 'videoRated' for every rating to prevent people rating for the same video more than once.

When someone adds a new rating they check userId, if not double rating, grab all ratings for that video/numberOfRatings, and then store the current rating in the database for that video?

 

or do they do it a different way? thanks J. 

Link to comment
Share on other sites

for my site http://phpsnips.com, I store multiple things, for each rating:

 

each snippet has 2 columns:

1. total # of votes

and

2. total of votes

#1 increments by one each time someone posts a vote

#2 increments by 1-5 if the person votes 4 it add 4 to the current total

 

 

Next to stop people from voting 2+ times in 24 hours, I store the snippet id, the vote (1-5) and the users IP address in a second table.

 

If you want to store the vote and show the person what they voted for, you would then save everything in the previous table, but since it is no use to me, I just delete it every 24 hours.

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.