jonniejoejonson Posted January 15, 2008 Share Posted January 15, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/86185-rating-script/ Share on other sites More sharing options...
The Little Guy Posted January 15, 2008 Share Posted January 15, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/86185-rating-script/#findComment-440166 Share on other sites More sharing options...
jonniejoejonson Posted January 15, 2008 Author Share Posted January 15, 2008 Thanks little Guy, I assume thatis how youtube do it aswell, as there isno way for you to recall the votes that you have cast... so thanks for your help. J Quote Link to comment https://forums.phpfreaks.com/topic/86185-rating-script/#findComment-440191 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.