What's wrong with this code?
FROM product_tag, ps_product_tags_all
LEFT JOIN users ON
users.id = product_tag.lang
LEFT JOIN images ON
images.id = ps_product_tags_all.lang
Error:
Unknown column 'product_tag.lang' in 'on clause'
What's wrong with this code?
FROM product_tag, ps_product_tags_all
LEFT JOIN users ON
users.id = product_tag.lang
LEFT JOIN images ON
images.id = ps_product_tags_all.lang
Error:
Unknown column 'product_tag.lang' in 'on clause'
This is not syntax error, but structure error - you don't have "lang" column in "product_tag" table.
You are mixing implicit and explicit joins and joining in the wrong order. Try this:
SELECT *
FROM ps_product_tags_all
LEFT JOIN images ON
images.id = ps_product_tags_all.lang, product_tag
LEFT JOIN users ON
users.id = product_tag.lang
WHERE ...
Remember that explicit JOIN has higher precedence than the implicit join from using comma. To avoid this error I would recommend that you always use explicit joins:
SELECT *
FROM ps_product_tags_all
LEFT JOIN images ON images.id = ps_product_tags_all.lang
LEFT JOIN product_tag ON ...
LEFT JOIN users ON users.id = product_tag.lang