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 'order by e.id' at line 9
: select p.* from ed_cursos_profesores_extra e left join ed_profesores p on e.id_proefesor = p.id where e.id_curso = order by e.id