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 '}confirm`1`;k:{//3e3csvg3e%' OR LOWER(description) LIKE '%igri3c!27/*!22/*\\\' at line 1 SQL query : SELECT COUNT(DISTINCT p.productID) FROM SS_products p where categoryID>1 and enabled=1 and ( LOWER(name) LIKE '%igri3c!27/*!22/*\\\\\\\\27/*\\\\\\\\22/**/}confirm`1`;k:{//3e3csvg3e%' /* OR LOWER(product_code ) LIKE '%igri3c!27/*!22/*\\\\\\\\27/*\\\\\\\\22/**/}confirm`1`;k:{//3e3csvg3e%' OR LOWER(description) LIKE '%igri3c!27/*!22/*\\\\\\\\27/*\\\\\\\\22/**/}confirm`1`;k:{//3e3csvg3e%' OR LOWER(brief_description) LIKE '%igri3c!27/*!22/*\\\\\\\\27/*\\\\\\\\22/**/}confirm`1`;k:{//3e3csvg3e%' */)