Generate table in PHP with specific data for MySQL

0

I have a table in a MySQL database, and I need to generate a table with PHP, but it is not a trivial table. My table has the following fields: codigo , item , preco and quantidade . I need to generate a table where for example I have the following data:

codigo = BC0001
item = molas tipo 2
preco = 5.92
quantidade = 10

My row in the table has a limitation of only 5 columns. I've already been able to generate a table that repeats the rows based on the quantity value, the problem is that when the quantity is = 10 as in the example above, it creates 10 rows of 5 columns and I need to create only two rows. / p>

If for example the quantity is = 7 , you have to fill one line and complete the line with data of other items, which have = 1, 3, 5 quantity, etc. Any tips?

    
asked by anonymous 05.10.2015 / 20:07

0 answers