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 profesor_2 = OR profesor_3 = ) ' at line 14
: SELECT d.*, case when e.id_curso_original is null then else e.id_curso_original end as id_curso_original, p.instagram FROM ed_cursos d left join co_cursos_ediciones e on e.id_curso = left join ed_profesores p on = d.profesor_1 WHERE d.oculto = 0 and fecha_inicio > now() and (profesor_1 = OR profesor_2 = OR profesor_3 = ) and d.modalidad = 'online' ORDER BY fecha_inicio