Rating system sql code
View Single Post
11-09-2008, 04:47 AM
Join Date: Sep 2007
Originally Posted by
@up- So.. how do you add rating to the user? If I rate someone as 3 of 5, then what will be inserted into db?
And also, how do you count how many ppl have rated?
1. How do you add rating to the user
Insert a row with the user ID being the ID of the user being rated and the rating as an integer ranging from 1-5. Individual database structures will vary, but that is the basic idea.
2. If I rate someone as 3 of 5, then what will be inserted into db?
A value of 3 and the ID of the user
3. And also, how do you count how many ppl have rated?
How many people have submitted a rating? You would have to add a column that contains the ID of the person who rated the person and write a query to count the distinct user IDs.
The Following User Says Thank You to Village Idiot For This Useful Post:
View Public Profile
Send a private message to Village Idiot
Find More Posts by Village Idiot