Подскажите пожалуйста куда копать с данной ошибкой?
PHP Notice: Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LCASE(pd.tag) LIKE '%%' OR LCASE(p.sku) = 'in' OR LCASE(p.upc) = 'in' OR LCASE(p' at line 1<br />Error No: 1064<br />SELECT p.product_id, (SELECT AVG(rating) AS total FROM review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND (LCASE(pd.name) LIKE '%in%') LCASE(pd.tag) LIKE '%%' OR LCASE(p.sku) = 'in' OR LCASE(p.upc) = 'in' OR LCASE(p.ean) = 'in' OR LCASE(p.jan) = 'in' OR LCASE(p.isbn) = 'in' OR LCASE(p.mpn) = 'in' GROUP BY p.product_id ORDER BY p.sort_order ASC, LCASE(pd.name) ASC LIMIT 0,12 in /home/s/.../.../public_html/system/database/mysql.php on line 49
/home/s/.../.../public_html/catalog/model/catalog/product.php(222): DB->query('SELECT p.product_id, (SELECT AVG(rating) AS total FROM review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating FROM product p LEFT JOIN product_description pd ON (p.product_id = pd.product_id) LEFT JOIN product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '1' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0' AND (LCASE(pd.name) LIKE '%12%') LCASE(pd.tag) LIKE '%%' OR LCASE(p.sku) = '12' OR LCASE(p.upc) = '12' OR LCASE(p.ean) = '12' OR LCASE(p.jan) = '12' OR LCASE(p.isbn) = '12' OR LCASE(p.mpn) = '12' GROUP BY p.product_id ORDER BY p.sort_order ASC, LCASE(pd.name) ASC LIMIT 0,12')