Lets say I have a store which sells general products… for example clothes and computers.
An item can have only one category.
So I have items which have a category (clothes, computers, etc), and depending on the category the item has attributes, and those attributes have values also depending on the category.
What would be a good approach to this?
So far I have a tbl_item which has a many-many relation to a table tbl_attribute, but I’m guessing I should change it to tbl_category maybe?
Seems like you’d have:
So, for a given item, you lookup the category_id. Take that to get a list of available attributes, and insert the appropriate ones into the item_attributes table.