mysql - Joining product attributes table with the product table to display product -


i have 3 tables listing products product attributes

product table dummy data

enter image description here

enter image description here

product_attributes dummy data

enter image description here

enter image description here

attributes dummy data

enter image description here

enter image description here

kespersky antivirus (productid = 1) has no attributes iphone (productid =2) has 2 attributes applicable it, memory , resolution both in attribute table has value stored in product_attribute table.

how join these tables show/display both products there corresponding attributes?

edit

i need display these products

enter image description here

the following work number of attributes:

select product.productid, product.name, group_concat(concat(attr.attributename, ":", pa.attributevalue)) product left outer join product_attributes pa  on (pa.productid = product.productid) left outer join attributes attr  on (attr.attributeid = pa.attributeid) group product.productid, product.name 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -