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