I have 4 sets of a star rating widget that saves to my db, values (1-5) from each star, where users can rate other users using those 4 star groups.
Something like:
is user x a jealous person? * * // (=2)
is user x a happy person? * * * * // (=4)
is user x a clever person? * * * * * // (=5)
is user x a humble person? * * * * * // (=5)
So after a vote I get a record like this:
*mysql sample row data
-------------------------------------------------------------------
ID from_user_id to_user_id rate_value
-------------------------------------------------------------------
1 2234 123 2
2 2234 123 4
3 2234 123 5
4 2234 123 5
-------------------------------------------------------------------
Running some sort a query. results the folllowing
id=1
from_user_id = 2234
to_user_id = 123
a1=2
a2=4
a3=5
a4=5
So best score a user can have is 20.
After an user have two or more score rows, I would like to save to another table a decimal score for him, from 0 to 10, say like: 7.1.
How can I do that? Sorry, I can't math.
If you want a 1-10 scale,