The key to JOINS is basically this:
SQL
"SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.secondarykey WHERE table2.type = $var"
it allows you to select items from the first table based upon a reference in the second table. In this case you would pull back all the "things" in table 1 that were associated with the type you specify in table2.
here is a madeupexample that isn't spectacular but does demonstrate the power:
Say we wanted to pull back all the red items of clothing from a shopping cart -
you have a table called product and a table called option -
the table option has 4 fields id, productid, color, type
SQL
"SELECT * FROM product LEFT JOIN option ON product.id = option.productid WHERE option.color = 'red'"
Hope this helps, sorry I didn't get to answer you better at work,
H