0

I am developing e-commerce website in cakephp 2.5 ,(answer is more suggestive than technical) the main issue, i am facing to add feature to product, i'm little bit confused to take decision to do this. because there are 5-7 type of products. each product has some common attributes(price, warranty, return policy, color ) and some different. i.g

category Dress,`
    `pent (waist size: 28, 30, 32, 34, 36, 40),
     shirt(XS, S,L, XL) 
     bra (34A, 34B etc)`,

electronics
 mobile(screen size, Ram, storage, speed,OS, memory card, processor type ), 
 laptop(Ram, Hard disk , processor, dimension, battery timing, OS), 
 Freezer(some other features) 

right now i have table for each product, is it right or something can be made better ? I have created model for each table in cakepphp.

i am asking to suggest me database design for different type of products with some same and some different features.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
coder
  • 156
  • 3
  • 23
  • @Robert I want experts to suggest me better database design for different kind of product with some different and some same features. AS under 1 category type "Electronics"; mobile, laptop, fridge, freezer, has different features" so what is better to save attributes for these. – coder Dec 16 '14 at 18:13
  • When you ask a question here, you want to make sure that the community is working on answering your question, and not spending time fixing your questions. You can help us do that by using proper English in your questions, and avoiding the use of bad forum habits like "EDIT". – Robert Harvey Dec 16 '14 at 18:18

1 Answers1

0

First, you need one table for all of your products.

Then, you need a table for the features.

FeatureID             Primary Key
Description           Text

Then you need a table linking multiple features to each product.

ProductFeatureID      Primary Key
ProductID             Foreign Key
FeatureID             Foreign Key
Robert Harvey
  • 178,213
  • 47
  • 333
  • 501