0

I am asked to make an inventory control for an online shop where they want to be able to enter dynamic attributes on their items.

the example i found was like in aliexpress example: https://www.aliexpress.com/item/1PCS-Heavy-duty-nylon-straps-20mm-22mm-24mm-Nylon-Watch-band-NATO-strap-zulu-strap-watch/32657441101.html?spm=2114.01010208.3.31.5IJhsi&ws_ab_test=searchweb201556_0,searchweb201602_4_10057_10056_10065_10068_10055_10054_10069_10059_10058_10073_10017_10070_10060_10061_10052_10062_10053_10050_10051,searchweb201603_3&btsid=ebc44e5a-1509-4914-9151-a45c9124fa35

(this one has many attributes) but other items they don't have the custom attribues, just price

example: https://www.aliexpress.com/item/1Pc-High-Quality-Fully-Adjustable-All-Metal-Watch-Band-Bracelet-Strap-Link-Pin-Remover-Repair-Tool/32645814543.html?spm=2114.01010108.3.128.meFTN1&ws_ab_test=searchweb201556_0,searchweb201602_4_10057_10056_10065_10068_10055_10054_10069_301_10059_10033_10058_10032_10073_10017_10070_10060_10061_10052_10062_10053_10050_10051,searchweb201603_3&btsid=b690c995-b1eb-4de7-9322-38028666bdf5

The user able to enter items name, items type then they can define the custom attributes such as color, size, type etc ... 1 items can have as many attributes. 1 attributes can be a multiple choices like color : red, green, blue, yellow. size: large, medium, smal. type: A,B,C,D,E

the customer should be able to order items and displayed like in aliexpress one. so in their order whould show ItemX with color:red, size:large, type:B, qty:10

or just ItemY with qty:8

I also need to be able to report which items that has been sold out and which one is available.

how to do that in mysql ? thank you.

Rick James
  • 135,179
  • 13
  • 127
  • 222
nightingale2k1
  • 10,095
  • 15
  • 70
  • 96
  • so put together a schema that would hold all the entities, and whatever you choose for your web layer (PHP, JSP, etc) ... build a dynamic query builder that is flexible. Google something like "PHP dynamic query builder implode" – Drew Sep 12 '16 at 01:59
  • Look after entity attribute value (EAV). It's a pattern which allow you to store unknown attributes like you need for your product. – Sylwit Sep 12 '16 at 02:00
  • See my answer to http://stackoverflow.com/questions/695752/how-to-design-a-product-table-for-many-kinds-of-product-where-each-product-has-m/695860#695860 – Bill Karwin Sep 12 '16 at 02:34
  • And after you have read Bill Karwin's answer, [look at mine](http://stackoverflow.com/questions/11779252/entity-attribute-value-table-design/11972029#11972029). – Joel Brown Sep 12 '16 at 10:43

0 Answers0