Hi, its been too long since Ive messed with php/mysql on any serious level...
Im doing a site with products that need sizes, and I cant seem to find a good way to design sizes into the database... (see last par of this message for the simple explanation of what Im trying to acheive here...)
It seems to me the best way to do this would be something like the following tables..
PRODUCT (0f course)
SIZE (with fields like size_id, size_name [eg - "sizes 8-12"])
SIZEOPTIONS (with fields like size_id, sizeoptions_id, size_option [eg - "size 8"]
PRODUCT_SIZE (this will link a product_id with the size_id, so we can say 'this product comes in this range of sizes')
Why I thought this system would be a good idea was because we could create a sizerange (size table), then fill in the different options for that range (sizeoptions table) then link a product with one or more 'size ranges'..
All this would be so that the size 'range' could be added to the product, and I thought I would still have the ability to quickly remove a size, say 'size 12' from a particular product if that became out of stock, but not have to continually make a new 'size range' if you get my drift.
Just explaining this makes me think its probably not the best way to go about this... added to this the fact that I ultimately just added a 'sizes available' field to the product_size table, which, eg, if we were missing size 10, would just fill in that field with a series of comma separated sizes "8,12,14,16" (filled in when the admin selects the size range, then unchecks the size options which are temporarily unavailble...) which would then have to be broken down and listed..
Does anyone have a clue what Im trying to explain ?
Is this even close to a typical table design that would solve the basic "being able to add a size range to a product then remove a size option temporarily if needed" ??
thanks for any input..
edit: (if it helps to understand I probably should have just made the size table an option table, as that is essentially what I want to add to the product, options...)
Im doing a site with products that need sizes, and I cant seem to find a good way to design sizes into the database... (see last par of this message for the simple explanation of what Im trying to acheive here...)
It seems to me the best way to do this would be something like the following tables..
PRODUCT (0f course)
SIZE (with fields like size_id, size_name [eg - "sizes 8-12"])
SIZEOPTIONS (with fields like size_id, sizeoptions_id, size_option [eg - "size 8"]
PRODUCT_SIZE (this will link a product_id with the size_id, so we can say 'this product comes in this range of sizes')
Why I thought this system would be a good idea was because we could create a sizerange (size table), then fill in the different options for that range (sizeoptions table) then link a product with one or more 'size ranges'..
All this would be so that the size 'range' could be added to the product, and I thought I would still have the ability to quickly remove a size, say 'size 12' from a particular product if that became out of stock, but not have to continually make a new 'size range' if you get my drift.
Just explaining this makes me think its probably not the best way to go about this... added to this the fact that I ultimately just added a 'sizes available' field to the product_size table, which, eg, if we were missing size 10, would just fill in that field with a series of comma separated sizes "8,12,14,16" (filled in when the admin selects the size range, then unchecks the size options which are temporarily unavailble...) which would then have to be broken down and listed..
Does anyone have a clue what Im trying to explain ?
Is this even close to a typical table design that would solve the basic "being able to add a size range to a product then remove a size option temporarily if needed" ??
thanks for any input..
edit: (if it helps to understand I probably should have just made the size table an option table, as that is essentially what I want to add to the product, options...)
Comment