More database than anything else, but I figure I’m going to be doing this in PHP so I’ll ask here
Below is a simplified table diagram with two products. There is a one to many relationship on product_ID to product_ID in the attributes table.
[IMG]
I’m having problems coming up with a matrix that will allow me to keep individual stock of variations. For example, product 1 would have small and large variations whereas product 2 will have small green, small blue, large green, large blue variations.
We don’t know how many attributes there are so having a seperate table with product_ID, attribute_1_id, attribute_2_id, quantity would not work so hot.
Any ideas on where I can even begin conceptualizing these tables? I very briefly thought about just putting the attribute_Ids into a comma seperated value on a quantity table (product_id, attributes, quantity) so that I could select say.. small, green product 2 with “select quantiy from quantity where attributes = “4,5”… but that seems.. wrong and hackish.
Are there any elegant solutions to doing this? I couldn’t find anything on google ?
Thanks for any help you can provide.