Multiple select query- help
Posted: Thu Jul 10, 2003 6:32 am
Hi all,
I have a few select boxes on a form for users to search my database.
Level
Nursery
Kindergarden
Primary
...
Subject
English
Math
Science
...
My db design is as follows I have, a table for teacher details linked by foreign keys to a table called Level and a table called Subject.
What I need is an efficient way to select all levels a user has keyed in the form (be it 1 or more) and match it with my teachers that can teach all these levels and subjects thru searching the columns for the said levels.
eg.
form- level choosen..Nursery, Kindergarden
- subject choosen... English, maths
db- table teacher details linked to level table, where it is stored as such... LevelID, TeacherID, Level
Now the problem is that a teacher can perhaps teach only 1 level or several levels.
AAA kindergarten
AAA Primary
BBB Secondary
BBB Primary
Therefore, I need to search the levels that match the type of levels and number of levels chosen by user in the search form, for each teacher.
Confused, yet? if not please throw me a bone. Thks!
I have a few select boxes on a form for users to search my database.
Level
Nursery
Kindergarden
Primary
...
Subject
English
Math
Science
...
My db design is as follows I have, a table for teacher details linked by foreign keys to a table called Level and a table called Subject.
What I need is an efficient way to select all levels a user has keyed in the form (be it 1 or more) and match it with my teachers that can teach all these levels and subjects thru searching the columns for the said levels.
eg.
form- level choosen..Nursery, Kindergarden
- subject choosen... English, maths
db- table teacher details linked to level table, where it is stored as such... LevelID, TeacherID, Level
Now the problem is that a teacher can perhaps teach only 1 level or several levels.
AAA kindergarten
AAA Primary
BBB Secondary
BBB Primary
Therefore, I need to search the levels that match the type of levels and number of levels chosen by user in the search form, for each teacher.
Confused, yet? if not please throw me a bone. Thks!