Originally Posted by
philip937
ive not seen anything in easy populate 4. its a table join ?I need help with.
To get what I need I need the product table joined with the attributes table and in turn joined with the table that contains the attributes name.
so joining 'products' to 'products_attributes' with products_id then 'products_attributes' to 'products_options_values' with products_options_values_id
If there is anyone that can help me build this query i'd be greatful for the help. Thanks
You mean both this won't do the trick for you and you didn't see it? It's been simplified down to the two pieces of data you were trying to display, but is essentially what you were after I thought, and EP4 can provide this as output to a file, so if you are trying to "reinvent" the wheel, was trying to save you some time unless there is some other need for the code to return that same type data.
Code:
SELECT
p.products_model as v_products_model,
o.products_options_name as v_products_options_name,
FROM '
.TABLE_PRODUCTS_ATTRIBUTES. ' as a,'
.TABLE_PRODUCTS. ' as p,'
.TABLE_PRODUCTS_OPTIONS. ' as o,'
.TABLE_PRODUCTS_OPTIONS_VALUES. ' as v
WHERE
a.products_id = p.products_id AND
a.options_id = o.products_options_id AND
a.options_values_id = v.products_options_values_id AND
o.language_id = v.language_id AND
o.language_id = 1 ORDER BY a.products_id, a.options_id, v.products_options_values_id'
Bookmarks