Hello. I'm developing a web interface to a db. I have two tables (foo,
bar) in an m-to-n relationship through a third table (foobar).
Basically foo is the main record from the user POV, and bar contains the
options of one of the fields.
What I'm trying to do is generate a list of all the bar options with the
ones selected by foo marked. Like this, where foo is related to
bar and bar:
It seems like this should be possible with a simple outer join, but I
cannot get it to work. The alternative is to do one query to get the
bars, and then check all N of them to see if they are related to foo[x]
or not. I don't want to use N+1 queries if 1 will do. I thought a
union might work somehow, but I'm using mySQL, so no unions.
Any ideas? Am I missing something simple?
Tim Larson - web programming guru
Red 5 Interactive, Inc. - www.r5i.com
4549 Fleur Dr. Des Moines, IA 50321