MySQL lookup query

Associate
Joined
16 May 2005
Posts
680
I've used a join table for a many to many relationship nav setup.

Its done in tiers > tier_one > tier_two etc

What I want to do within the CMS is allow users to add tiers to the above tiers by showing what tiers are available over and above the realtions already in place.

I've got the tiers table:
tier_two

With the columns:
tier_two_id
tier_two_name

The lookup table:
tier_onetwo

Which has columns:
tier_one_id
tier_two_id

Now I have both the tier one and tier two ids, what I need to do is effectively pull out the tier_two_id and tier_two_name from tier_two that doesn't already exist in the lookup table with the tier_one_id and tier_two_id.

Not sure if I'm making sense with this one. I've currently done it by loading the tier_two_ids already in the lookup table into a variable then putting that in the middle of the query so it doesn't pull them out, but it's a bit untidy and I was wondering if anyone had any other thoughts?

Cheers
 
Back
Top Bottom