SELECT COUNT(id) AS nr FROM restaurants_products WHERE restaurant_id=391 AND active=1 AND (category_id NOT IN (233,235,236,237,238,239,261,263,264,265,266,373,380,381,786,808,809,810,811,812,813,940,1050,1086,1256,1257,1264,1265,1266,1267,1331,1332,1333,1334,1335,1336,1337,1338,1339,1373,1375,1380,1391,1417,1610,1927,1996,1998,2031,2032,2058,2425,2426,2739,2890,2933,3059,3160,3190,3314,3451,3479,3480,3482,3483,3484,3485,3500,3501,3502,3503,3838,3949,3982,3983,4089,4145,4181,4182,4183,4184,4185,4217,4230,4403,4439,4496,4518,5081,5109,5244,5339,5542,5775,5889,5890,5921,6035,6053,6174,6415,6435,6456,6591,6626,6803,6823,7100,7114,7116,7214,7464,7465,7521,7522,7524,7534,7675,7677,7837,7845,7871,7986,8019,8046,8090,8283,8284,8350,8432,8566,8567,8568,8569,8570,8571,8615,8619,8621,8622,8623,8638,8639,8640,8641,8642,8643,8644,8653,8654,8742,8743,8744,8775,8847,8848,8849,8850,8978,9000,9017,9073,9074,9139,9295,9359,9367,9375,9436,9437,9438,9462,9466,9470,9519,9538,9544,9546,9547,9548,9549,9550,9593,9694,9946,9947,9948,9949,9950,9951,10012,10046,10134,10136,10137,10143,10228,10230,10330,10331,10590,10647,10648,10649,10650,10761,)) AND (display_days='' OR display_days LIKE '%0%');You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')) AND (display_days='' OR display_days LIKE '%0%')' at line 1