Obtenez des lignes de 1 table avec une autre table MySQL vide
SELECT students.name, students.lastname, ifnull(courses.course_name, '-') as course_name
FROM students
LEFT JOIN courses
ON courses.id_student=students.id_student
WHERE students.name LIKE '%$search%'
GROUP BY students.id_student
ORDER BY students.name, students.lastname, courses.course_name
Ivan The Terrible