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(1133638780)))and"%'' at line 1 SQL query : SELECT COUNT(DISTINCT p.productID) FROM SS_products p where categoryID>1 and enabled=1 and ( LOWER(name) LIKE '%jp%' /* OR LOWER(product_code ) LIKE '%jp%' OR LOWER(description) LIKE '%jp%' OR LOWER(brief_description) LIKE '%jp%' */) AND ( LOWER(name) LIKE '%s3188-86a-btbfpc%' /* OR LOWER(product_code ) LIKE '%s3188-86a-btbfpc%' OR LOWER(description) LIKE '%s3188-86a-btbfpc%' OR LOWER(brief_description) LIKE '%s3188-86a-btbfpc%' */) AND ( LOWER(name) LIKE '%v3.0"and/**/extractvalue(1,concat(char(126),md5(1133638780)))and"%' /* OR LOWER(product_code ) LIKE '%v3.0"and/**/extractvalue(1,concat(char(126),md5(1133638780)))and"%' OR LOWER(description) LIKE '%v3.0"and/**/extractvalue(1,concat(char(126),md5(1133638780)))and"%' OR LOWER(brief_description) LIKE '%v3.0"and/**/extractvalue(1,concat(char(126),md5(1133638780)))and"%' */)