Fallen_angel Posted November 27, 2006 Share Posted November 27, 2006 I need to make a rating system for my website and need some help with the way i want to display it basicly I have an idea of what i need to do but don't know how to go abotu doing it , the perfect script would be able to use X ( database value) as the number of images to show in the rowthat way say if the person had a rating of 4 , then 4 images would apear my other option ofcourse is to have it as seperate files wich is what i have in place at the moment but i figured if I was doign all i can to learn then I want to use php as much as possible :) Link to comment https://forums.phpfreaks.com/topic/28605-rating-system/ Share on other sites More sharing options...
ess14 Posted November 27, 2006 Share Posted November 27, 2006 well, this is the way id do it....Database needs an ITEMS table and a RATINGS table.items table has item name and ID (at least).ratings table has ID (for matching with items) and 5 columns for ratings (ie 1 through 5).so for instance:TABLE ITEMS:id=1 Name=BookTABLE RATING:id=1 rating1=3 rating2=1 rating3=2 rating4=10 rating5=5then you use php to retrieve the ratings from the rating table (based on ID) then perform operations to average out the rating and then display the approproate images/ratings on ur page.As for when someone actually rates something, you just add 1 to the appropriate column in ratings based on the ID. Link to comment https://forums.phpfreaks.com/topic/28605-rating-system/#findComment-130881 Share on other sites More sharing options...
gin Posted November 27, 2006 Share Posted November 27, 2006 There's a tutorial about this here:http://www.phpfreaks.com/tutorials/9/0.phpNot entirely code efficient, but an okay beginner tutorial. Link to comment https://forums.phpfreaks.com/topic/28605-rating-system/#findComment-130885 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.