MySQL Query Error

SELECT count(*) FROM `lbcms_products` WHERE `show`=1 and attribute_id in(0,22) and (title like '%N%') or (regulatory like '%N%') and attribute_id in(0,22) or (cat like '%N%') and attribute_id in(0,22)
MySQL server has gone away