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 kd_id IN (SELECT au_kd_id FROM firmen_rechte WHERE au_portal = 'rlp'))' at line 1