I am doing a system to carry out courses.
I have 2 tables, one of name "Index" and another "Completed", in "Index", I keep the index of the course (ie the curriculum, units, exams, etc) and "Completed" the id
of the user and the id
of the index table that is already complete. Then one in a query as follows:
select * from indice_cursos a left join completado b on a.Id=b.id_completado and b.id_usuario=$id_usuario where a.id_curso=$id_curso
What I need is to get the first record of the index that the user has not yet completed.
I attach images of the tables
Table Index:
Table completed:
Left Join Query:
How should the consultation be? Thanks !!!