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 '1045g/**/orion/**//**/lcd/**//**//**/")%' OR LOWER(d' at line 1 SQL query : SELECT COUNT(DISTINCT p.productID) FROM SS_products p where categoryID>1 and enabled=1 and ( LOWER(name) LIKE '%bq/**//*!308701045g/**/orion/**//**/lcd/**//**//**/")%' /* OR LOWER(product_code ) LIKE '%bq/**//*!308701045g/**/orion/**//**/lcd/**//**//**/")%' OR LOWER(description) LIKE '%bq/**//*!308701045g/**/orion/**//**/lcd/**//**//**/")%' OR LOWER(brief_description) LIKE '%bq/**//*!308701045g/**/orion/**//**/lcd/**//**//**/")%' */) AND ( LOWER(name) LIKE '%as%' /* OR LOWER(product_code ) LIKE '%as%' OR LOWER(description) LIKE '%as%' OR LOWER(brief_description) LIKE '%as%' */) AND ( LOWER(name) LIKE '%rbxy%' /* OR LOWER(product_code ) LIKE '%rbxy%' OR LOWER(description) LIKE '%rbxy%' OR LOWER(brief_description) LIKE '%rbxy%' */) AND ( LOWER(name) LIKE '%where%' /* OR LOWER(product_code ) LIKE '%where%' OR LOWER(description) LIKE '%where%' OR LOWER(brief_description) LIKE '%where%' */) AND ( LOWER(name) LIKE '%5212=5212%' /* OR LOWER(product_code ) LIKE '%5212=5212%' OR LOWER(description) LIKE '%5212=5212%' OR LOWER(brief_description) LIKE '%5212=5212%' */) AND ( LOWER(name) LIKE '%order%' /* OR LOWER(product_code ) LIKE '%order%' OR LOWER(description) LIKE '%order%' OR LOWER(brief_description) LIKE '%order%' */) AND ( LOWER(name) LIKE '%by%' /* OR LOWER(product_code ) LIKE '%by%' OR LOWER(description) LIKE '%by%' OR LOWER(brief_description) LIKE '%by%' */) AND ( LOWER(name) LIKE '%1*/--%' /* OR LOWER(product_code ) LIKE '%1*/--%' OR LOWER(description) LIKE '%1*/--%' OR LOWER(brief_description) LIKE '%1*/--%' */) AND ( LOWER(name) LIKE '%qxic%' /* OR LOWER(product_code ) LIKE '%qxic%' OR LOWER(description) LIKE '%qxic%' OR LOWER(brief_description) LIKE '%qxic%' */)