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 '(lower(p.sku_name) LIKE '%wifi%' or lower(p.sku_descriptionA) LIKE '%wifi%' or l' at line 1 MYSQL: select count(*) from products p where p.sku_brand = '256' && p.sku_category IN('21402') && (lower(p.sku_name) LIKE '%wifi%' or lower(p.sku_descriptionA) LIKE '%wifi%' or lower(p.cat_name) LIKE '%wifi%' or lower(p.sku_brandname) LIKE '%wifi%' or lower(p.sku_descriptionB) LIKE '%wifi%')(lower(p.sku_name) LIKE '%wifi%' or lower(p.sku_descriptionA) LIKE '%wifi%' or lower(p.cat_name) LIKE '%wifi%' or lower(p.sku_brandname) LIKE '%wifi%' or lower(p.sku_descriptionB) LIKE '%wifi%')