I have two tables, users and teaching
The users table contains both teachers and students. The teaching table contains the relation between the two.
I want to be able to get the student based off who "teaches" them.
Both teachers and students have an id, and I would have the teachers id to look up in the teaching table to find the students they teach.
Any ideas as to how this is done? I would like it to return the id of the student.
I've tried doing a simple join statement, but this would fetch the teacher, not the student.
Thanks in advance