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]).
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?
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
INSERT INTO table_name VALUES ('','','','','','some specification','','some specification'....etc)`
How to manage the set of specifications for every subcategory?
Specifications look like this:
- Manufacturer : Sony
- Processor : Intel Core i3
- Memory : 3 GB DDR3
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.
and every product have different specifications ... (not only the name of the specification but the specification itself. like video cards, ram, hdd, ).