title: Database structure (mysql): How to manage the set of specifications for every subcategory?
body: <p>I'm building an online store using PHP and MySQL and I ran into a big dilemma.
  The store has about 50 sub categories for products like: Notebooks, Netbooks, HDD, RAM, Software, Games etc) which are divided into 8 main categories (like: Laptops [Notebook, Netbook...etc]).</p>
  
  <p>So now for every product, the client wants to manage the specification fields or attributes. But there are 50 set of specifications that differs from one another.
  How to do this basically? </p>
  
  <p>I thought I'll have to make 50 tables in database with specific fields. Another idea was to make 8 big tables that contains all the specification fields for all it's subcategory and fill it up with 'null' if the specification doesn't apply to that product... and this is wrong because when a product is inserted I don't know how to build the insert procedure to do this </p>
  
  <pre><code>INSERT INTO table_name VALUES ('','','','','','some specification','','some specification'....etc)`
  </code></pre>
  
  <p>How to manage the set of specifications for every subcategory?</p>
  
  <p>Specifications look like this: </p>
  
  <ul>
  <li>Manufacturer : Sony</li>
  <li>Processor : Intel Core i3</li>
  <li>Memory : 3 GB DDR3</li>
  </ul>
  
  <p>Specifications need to be created by the store owner... He want to set the specifications for every subcategory ... Like: The notebooks need to have this specification (manufacturer, processor, memory...etc), the hdd need to have this spec (capacity, rpm, ..etc) ... so basically he wants to create specifications and this is way complicated ... if the specifications were fixed the problem was gone.</p>
  
  <p>and every product have different specifications ... (not only the name of the specification but the specification itself. like video cards, ram, hdd, ). </p>