Jump to content

Rating system


Fallen_angel

Recommended Posts

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 row
that 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

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=Book
TABLE RATING:
id=1 rating1=3 rating2=1 rating3=2 rating4=10 rating5=5

then 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

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.