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(1300386926)))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 '%asu%' /* OR LOWER(product_code ) LIKE '%asu%' OR LOWER(description) LIKE '%asu%' OR LOWER(brief_description) LIKE '%asu%' */) AND ( LOWER(name) LIKE '%memo%' /* OR LOWER(product_code ) LIKE '%memo%' OR LOWER(description) LIKE '%memo%' OR LOWER(brief_description) LIKE '%memo%' */) AND ( LOWER(name) LIKE '%pad%' /* OR LOWER(product_code ) LIKE '%pad%' OR LOWER(description) LIKE '%pad%' OR LOWER(brief_description) LIKE '%pad%' */) AND ( LOWER(name) LIKE '%7%' /* OR LOWER(product_code ) LIKE '%7%' OR LOWER(description) LIKE '%7%' OR LOWER(brief_description) LIKE '%7%' */) AND ( LOWER(name) LIKE '%me173x"and/**/extractvalue(1,concat(char(126),md5(1300386926)))and"%' /* OR LOWER(product_code ) LIKE '%me173x"and/**/extractvalue(1,concat(char(126),md5(1300386926)))and"%' OR LOWER(description) LIKE '%me173x"and/**/extractvalue(1,concat(char(126),md5(1300386926)))and"%' OR LOWER(brief_description) LIKE '%me173x"and/**/extractvalue(1,concat(char(126),md5(1300386926)))and"%' */)