How to load 5th review count php

php
mysql

#1

As every review system Opencart also using the 5star rating system where in default it prints total reviews by using the following
(SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews,

Where I just want to count the reviews with the rating of 5 and just modified SQL as
(SELECT COUNT(*) AS total FROM " . DB_PREFIX . "review r2 WHERE r2.rating = '5' AND r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews,

But it is not working at all and displays the same result... So am I doing anything wrong... Please suggest me...

Thanks in advance


#2

Sorry, this works perfectly... My mistake I didn't clear cache


#3

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.