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 ') or (b.idpadreN2 = ) or (b.id = )) and (a.id < 2464) and a.estado = 0 and a.est' at line 1