functionality for star rating from db