[eluser]Jeffrey Lasut[/eluser]
How do I handle a join with multiple conditions in DMZ style?
This is the query that I want as a result:
Code:
SELECT
n.*
FROM products n
LEFT JOIN properties p
ON p.product_id = n.id
JOIN fields f
ON p.field_id = f.id
JOIN types t
ON n.type_id = t.id
JOIN categories w
ON n.category_id = w.id
WHERE f.name = '".$field."'
AND p.value = '".$value."'
AND p.version = n.version
AND t.name = '".$type_name."'
AND w.id = '".$category_id."'