[eluser]skattabrain[/eluser]
sorry! my initial post was not the problem.
i made some edits, but still have an issue ....
here is what i want to run ...
where '1003' was created by the variable $product_id
SELECT * FROM (`ingredient_item`)
JOIN `ingredient_type` ON ingredient_type.ingredient_type_id = ingredient_item.ingredient_type_id
LEFT JOIN `ingredient_to_product` ON ingredient_to_product.product_id = '1003' AND ingredient_to_product.ingredient_id = ingredient_item.ingredient_id
ORDER BY `ingredient_type`, `ingredient`
here is what runs ...
SELECT * FROM (`ingredient_to_product`)
JOIN `ingredient_item` ON ingredient_item.ingredient_id = ingredient_to_product.ingredient_id
JOIN `ingredient_type` ON ingredient_type.ingredient_type_id = ingredient_item.ingredient_type_id
WHERE `product_id` = '1003'
ORDER BY `ingredient_type`, `ingredient`
so it pulls the variable ... but my query is not waht i want.
basically ... my query wants "all ingredients" and if the product 1003 has that ingredient, get that result.