![]() We encourage useful, constructive feedback. Read about the journey of reviews on Trustpilot. We show reviews chronologically, and you can filter by star rating, language, location, or keyword. I am using MySQL for this and it works like a charm.Any DB systems is fine. Reviews are published instantly, without moderation. Rating has to be stored somewhere in a MySQL database (Is this a good idea?) Return the value back to the server, and from the server back to the client. 1/5 + 2/5 + 4/5, etc), divide it(sum) by the total amount of ratings and multiplies it by 100. Write a SQL script that, based on the product id, takes the sum of the average rating (i.e. Some sort of average shown beside the starsĮasy. ![]() Page doesn't have to be reloaded when a star is clicked (not really needed)Ījax is your friend, what I did was to have a where represented a star and the submitRating() function used Ajax to transmit my rating (1/5) to the server, the server stores the rating (and assigns the user that gave the rating) and recalculates the new average rating and submit the results back in JSON format. ![]() It's purely CSS so no need for Javascripting. There's a brilliant tutorial on the web for designing a 5 star rating system.
0 Comments
Leave a Reply. |