You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and b.id not in (4582,17,41,56,26,42,57,27,43,58,28,44,59,29,45,60,30,46,31,47) ' at line 1