dagon;10888510 wrote:explode in to an array
then use array_sum() and count()
hey thanks for the reply the thing is though im storing the rating on the database.
so i have 2 fields called rating & vote_count.
the numbers I showed before i was justt writing what inputs could be sent in. 5 Stars rating.
so if someone voted now 5 i would guess the average, but maybe i was thinking this to much?
(input)5 / 1 (vote_count) = 5
then someone votes 3
(input)3 + (rating)5 / 2 = 4
then another vote 1.5
(input)1.5 + (rating)4 / 3 = 1.8
then another raitn 3.5
(input)3.5 + (Rating)1.8 / 4 = 1.3
so the average keeps going down. any idea?