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
https://forums.phpfreaks.com/topic/86185-rating-script/
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
https://forums.phpfreaks.com/topic/86185-rating-script/#findComment-440166
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.