Oh my that's a lot of code. If I understand your question correctly then you've really out-done yourself. All the popular databases I'm aware of have JOIN statements (that link is the mysql version, but I'm certain the same principles apply for most databases)
The moral: when trying to manipulate database stuff, check your databases docs first! It will save you lots of time (yes I've learned that the hard-way)
As an extra here's a start on what you are trying to do. This *should* (untested) get all of your ID's and their coorisponding colors, one entry per color, so you'll have multple IDs that are the same (hint you can use that to put together lists to build your pop-up with). Anyway here's the query:
SELECT item_id, color FROM catalog_pet LEFT JOIN colors USING (item_id);
Hope that helps
Chris
In reply to Re: Joining Tables Problem
by cfreak
in thread Joining Tables Problem
by b310
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |