View Single Post
Old 12-07-2007, 04:34 AM   #8 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Sorry, completely missed your last question, Gurnk! Basically it's all down to the JOINs:
  1. Join picture.id to picture_categories.id based on WHERE clause (one to many);
  2. Join picture_categories.category_id to categories.id (many to many);

Key:
Blue = Table
Green = Column

So for every ID that matches to the picture's image in our lookup table, get all the IDs that match up to a categories in the categories table.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
The Following User Says Thank You to Wildhoney For This Useful Post:
codefreek (12-29-2007)