Notice: Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(rating) AS total FROM myoc_review r1 WHERE r1.product_id = p.product_id AND r1.' at line 1
Error No: 1064
SELECT SQL_CACHE p.product_id, (SELECT SQL_CACHE AVG(rating) AS total FROM myoc_review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM myoc_product p LEFT JOIN myoc_product_description pd ON (p.product_id = pd.product_id) LEFT JOIN myoc_product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN myoc_product_to_category p2c ON (p.product_id = p2c.product_id) INNER JOIN myoc_product_attribute pa1 ON ( pa1.product_id = p.product_id AND pa1.attribute_id = '20' AND pa1.text IN ('Essence')) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND (p2c.category_id IN(5032,5559,5553,5555,5554,5560,5556,5245,5266,5250,5545,5543,5546,5541,5562,5563,5564,5565,5399,5416,5374,5422,5403,5404,5395,5406,5426,5411,5377,5410,5419,5429,5381,5382,5385,5387,5415,5389,5391,5421,5417,5430,5412,5177,5506,5178,5649,5179,5540,5650,5181,5189,5175,5651,5161,5170,5162,5636,5033,5547,5561,5034,5552)) GROUP BY p.product_id ORDER BY p.sort_order ASC LIMIT 0,16 in /home/gassibco/domains/domstyle.com.ua/public_html/system/database/mysql.php on line 69