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(1760285231)))and"%' OR L' at line 1 SQL query : SELECT COUNT(DISTINCT p.productID) FROM SS_products p where categoryID>1 and enabled=1 and ( LOWER(name) LIKE '%+++goclever+tab+r+76.2"and/**/extractvalue(1,concat(char(126),md5(1760285231)))and"%' /* OR LOWER(product_code ) LIKE '%+++goclever+tab+r+76.2"and/**/extractvalue(1,concat(char(126),md5(1760285231)))and"%' OR LOWER(description) LIKE '%+++goclever+tab+r+76.2"and/**/extractvalue(1,concat(char(126),md5(1760285231)))and"%' OR LOWER(brief_description) LIKE '%+++goclever+tab+r+76.2"and/**/extractvalue(1,concat(char(126),md5(1760285231)))and"%' */)