I have a complete table in MySQL
|Product|Market|Qty|Date
|A |M1 |1 |01/01/2015
|A |M2 |1 |01/01/2015
|B |M1 |1 |01/01/2015
|C |M3 |1 |01/01/2015
|B |M1 |1 |01/01/2015
|A |M2 |1 |01/01/2015
How do i populate them in HTML Table such that
Product|M1|M2|M3|M4
A |1 |2 |0 |0
B |2 |0 |0 |0
C |0 |0 |0 |1
Can anyone help me right direction here. Looked into many MySQL transpose and pivot code but not able to implement it or understand it.
Trying to learn and understand here.