aijosh
Member
Hello,
I need to display the average rating of all the rating records of a user from some list into another list.
So
:: a user can add say 20 record into different lists (or the same list)
:: each record of the user has a rating
I need to read all the ratings of the user and do an average (this would not be the rating of the user) and display this result on another list or/and detail view where the user profile is loaded. [this list does not have a rating element]
I dont know which route is best. I'm thinking should I do a php to read the database and all tables each time the list and detail view is loaded or try a calc?..... not sure and need direction.
Note that a lot of user profiles (showing their average rating) would be displayed at once, so speed is a big factor here
Also since this rating is like a real time thing dependent on all other ratings and changes each time, is it necessary to save the record in the database or its best to just always do a realtime calculation?
I need to display the average rating of all the rating records of a user from some list into another list.
So
:: a user can add say 20 record into different lists (or the same list)
:: each record of the user has a rating
I need to read all the ratings of the user and do an average (this would not be the rating of the user) and display this result on another list or/and detail view where the user profile is loaded. [this list does not have a rating element]
I dont know which route is best. I'm thinking should I do a php to read the database and all tables each time the list and detail view is loaded or try a calc?..... not sure and need direction.
Note that a lot of user profiles (showing their average rating) would be displayed at once, so speed is a big factor here
Also since this rating is like a real time thing dependent on all other ratings and changes each time, is it necessary to save the record in the database or its best to just always do a realtime calculation?
Last edited: