I am new to PHP and MySQL and require help with an issue I am facing. I am trying to create a table that is cleaner then the following:
Table example
Item |Part |Quantity
Item1 |123 |2
Item1 |124 |2
Item2 |123 |1
Item2 |125 |3
I can do this with a normal table but I can envision the database having tons of repeat rows with duplicate data. For example I used Item1 multiple times to identify each part.
I was wondering if there was a cleaner way to store this data in my database? I will be using PHP to store the data into MySQL. I am also looking to make the Item column unique but as it stands, can not do this.
I looked into serialize, join as well as an array but I couldn't figure out how to make it all fit so I thought I would ask here. The end results would be a PHP report that says:
Item 1 uses the following parts
Part 123 : Quantity 2
Part 124 : Quantity 2
Item 2 uses the following parts
Part 123: Quantity 1
Part 125: Quantity 3
Any help would be greatly appreciated.