View Single Post
Old 11-09-2008, 04:47 AM   #14 (permalink)
Village Idiot
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by Tanax View Post
@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.
__________________

Village Idiot is offline  
Reply With Quote
The Following User Says Thank You to Village Idiot For This Useful Post:
Orc (11-09-2008)