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 'extractvalue(1,concat(char(126),md5(1890658501)))and''%' OR LOWER(description' at line 1 SQL query : SELECT COUNT(DISTINCT p.productID) FROM SS_products p where categoryID>1 and enabled=1 and ( LOWER(name) LIKE '%c390c2bac390c2bec391e282acc390c2bfc391c692c391c281%' /* OR LOWER(product_code ) LIKE '%c390c2bac390c2bec391e282acc390c2bfc391c692c391c281%' OR LOWER(description) LIKE '%c390c2bac390c2bec391e282acc390c2bfc391c692c391c281%' OR LOWER(brief_description) LIKE '%c390c2bac390c2bec391e282acc390c2bfc391c692c391c281%' */) AND ( LOWER(name) LIKE '%c390c2b4c390c2bbc391c28f%' /* OR LOWER(product_code ) LIKE '%c390c2b4c390c2bbc391c28f%' OR LOWER(description) LIKE '%c390c2b4c390c2bbc391c28f%' OR LOWER(brief_description) LIKE '%c390c2b4c390c2bbc391c28f%' */) AND ( LOWER(name) LIKE '%s%' /* OR LOWER(product_code ) LIKE '%s%' OR LOWER(description) LIKE '%s%' OR LOWER(brief_description) LIKE '%s%' */) AND ( LOWER(name) LIKE '%312''and/**/extractvalue(1,concat(char(126),md5(1890658501)))and''%' /* OR LOWER(product_code ) LIKE '%312''and/**/extractvalue(1,concat(char(126),md5(1890658501)))and''%' OR LOWER(description) LIKE '%312''and/**/extractvalue(1,concat(char(126),md5(1890658501)))and''%' OR LOWER(brief_description) LIKE '%312''and/**/extractvalue(1,concat(char(126),md5(1890658501)))and''%' */)