I have a little situation, and since I'm not incredibly descent at mySQL, I'm having a bit of trouble.
I'm writing a script to generate a listing of educational departments for a school. In each one of those departments displayed, I am attempting to display all the teachers involved in that department, and the courses that go along with it.
Right now im starting off by selecting all the records from the dept field.. then for each record im executing 2 queries. It first selects records from teachers where id_dept1=$deptid OR id_dept2=$deptid OR id_dept3=$deptid. The second is select from courses where id_dept=$deptid
Does anyone have a faster way to do this with more advanced SQL (Joins, etc...)? I'm having quite the time doing this. Any help would be appreciated.