SELECT COUNT(id) AS nr FROM restaurants_products WHERE restaurant_id=481 AND active=1 AND (category_id NOT IN (236,237,238,239,267,380,381,786,808,809,810,811,812,813,940,1050,1072,1256,1257,1264,1265,1266,1267,1331,1332,1333,1334,1335,1336,1337,1338,1339,1373,1375,1380,1391,1398,1417,1610,1673,1677,1927,1996,2031,2032,2058,2253,2425,2426,2739,2933,3060,3061,3064,3089,3159,3160,3170,3171,3314,3400,3451,3479,3480,3482,3483,3484,3485,3500,3501,3502,3503,3838,3949,3982,3983,4089,4145,4217,4230,4365,4373,4403,4518,5081,5109,5194,5244,5252,5339,5517,5524,5538,5539,5775,5864,5889,5890,5921,6053,6174,6415,6456,6591,6626,6803,6823,7100,7114,7116,7214,7675,7743,7770,7774,7837,7845,7871,7986,8019,8046,8090,8182,8283,8284,8350,8566,8567,8568,8569,8570,8571,8615,8619,8621,8622,8623,8638,8639,8640,8641,8642,8643,8644,8653,8654,8712,8713,8714,8716,8727,8757,8775,8817,8818,8819,8820,8821,8822,8823,8824,8825,8826,8837,8847,8848,8849,8850,8892,8893,8894,8980,9000,9017,9073,9074,9139,9140,9141,9295,9359,9367,9436,9437,9438,9462,9470,9519,9538,9544,9546,9547,9548,9549,9550,9593,9694,9946,9947,9948,9949,9950,9951,10012,10046,10134,10136,)) AND (display_days='' OR display_days LIKE '%5%');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 '%5%')' at line 1