I have 3 tables, let say they are like this:
Table1 = Student (id, name, ...)
Table2 = Supervisor (id, name, ...)
Table3 = Supervision (id, student=Student.id, supervisor=Supervisor.id, owner, ...)
If Supervisor login and open Table1 (Student), he will see his assigned Students only .
I think the query for doing this filtering is like this:
Code: Select all
SELECT * FROM Student AS stdn LEFT JOIN Supervision AS spvn ON spvn.student = stdn.id LEFT JOIN Supervisor AS spvr ON spvr.id=spvn.supervisor WHERE spvr.id='$memberInfo['username']'
Can some one help me.
Thanks.