Ok i want to make a simple rating script. basically i will have the user choose a value between 10 and 0 from like a radio button or drop down menu, and that info will be fed into a MySQL Column, ok so then once i have lets say a few of these ratings done by differnt users how do calculate an overall average?
|------------------|
|ID|Message|Rating|
|------------------|
|1|hello|2|
|2|hi|9|
|3|yo man|7|
|4|homes|10|
|------------------|
ok so lets my table looks like that....how do i use the numbers from the "Ratings" column to display an overall average?
thank you!
Very simple ratings script.
Moderator: General Moderators
I'd try the AVG(expr) function on rating 
I think what I'd do is keep 2 numbers in a database.
1 the total of all votes added up
2 the total nr of votes
Oh and I do believe I remember that php doesn't work with 9.5 and such so I might use 10 in stead of 1 in the script just to make it work more detailed.
That should be easy enough to make a script do.
Then just divide one by the other. And put a dot in at the right place.
1 the total of all votes added up
2 the total nr of votes
Oh and I do believe I remember that php doesn't work with 9.5 and such so I might use 10 in stead of 1 in the script just to make it work more detailed.
That should be easy enough to make a script do.
Then just divide one by the other. And put a dot in at the right place.