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 ') ORDER BY sort_order, name' at line 1
SELECT categoryID, `name_ru` AS name, products_count, picture, slug FROM SC_categories WHERE categoryID<>0 and parent=1 and categoryID not in () ORDER BY sort_order, name