I have a list of nealry 800 products in a database in the following
format:
name | price | url
prod1 | $10 | www.comp1.com
prod1 | $11 | www.comp1.com
prod1 | $10.5 | www.comp1.com
prod1 | $21 | www.comp2.com
prod1 | $18 | www.comp2.com
....
prod100 | $17 | www.comp3.com
....
There are 8 different companies and 100 different products. I need to
format the data into the following format:
name | price (company)
prod name | comp1 | comp1 | comp3 | ... | comp8
prod1 | $10 | $11 | $10.5 |...
prod2 | $21 | null | $18 | ...
....
prod100 | $17 | $13 | $15 | ...
So my report is 100x8 table filled with the correct data. Because not
every company manufactures all the products, some cells will be empty
- prod2[comp2].
I can't think of any easy way doing it other than creating 100x8 array
and than filling the cells cell[85][4]='$23', etc..
format:
name | price | url
prod1 | $10 | www.comp1.com
prod1 | $11 | www.comp1.com
prod1 | $10.5 | www.comp1.com
prod1 | $21 | www.comp2.com
prod1 | $18 | www.comp2.com
....
prod100 | $17 | www.comp3.com
....
There are 8 different companies and 100 different products. I need to
format the data into the following format:
name | price (company)
prod name | comp1 | comp1 | comp3 | ... | comp8
prod1 | $10 | $11 | $10.5 |...
prod2 | $21 | null | $18 | ...
....
prod100 | $17 | $13 | $15 | ...
So my report is 100x8 table filled with the correct data. Because not
every company manufactures all the products, some cells will be empty
- prod2[comp2].
I can't think of any easy way doing it other than creating 100x8 array
and than filling the cells cell[85][4]='$23', etc..
Comment