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 a.id_artykuly NOT IN (16844,16776,16710,16669) and id_statusy=7 and id_artyk' at line 1