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 ') LIMIT 1' at line 3 SQL: SELECT name FROM magic_assortment_filter WHERE group_id = 3 AND id IN () LIMIT 1