-1
Good Afternoon
I have a table on MYSQL
<?php
$pesquisa = "SELECT * From tabelaProdutos";
ID / Código / Descrição / Qtd
1 /0001 / Caixa Azul 1/ 1
2 /0002 / Caixa Azul 2/ 3
3 /0003 / Caixa branca 1/ 12
4 /0001 / Caixa Preta 1/ 11
How do I make each loop I put a different condition.
I need the user to receive tables separated by description as the examples below.
Example Table 1
ID / Código / Descrição / Qtd
1 /0001 / Caixa Azul 1/ 1
2 /0002 / Caixa Azul 2/ 3
Table 2
3 /0003 / Caixa branca 1/ 12
Table 3
4 /0001 / Caixa Preta 1/ 11
I need to make one SELECT for each table ? or has some easier and more correct way to do this ?
Thank you
Your question was not very clear, I did not understand very well what you need
– gabrielfalieri
There are three different comics tables?
– gabrielfalieri
No. I need to generate in html the 3 tables, but I would like to know for each table I need to create a different SELECT, or only a SELECT I can do the 3 tables in html
– Junior
It gets complicated to say if we don’t know the conditions you want to use to separate the data into 3 sets.
– bfavaretto
By description, one for blue box, one for white box and one for black box
– Junior
Actually whatever, you can do a single query and 3 loops, or 3 queries and 3 loops.
– bfavaretto
As an example I have this loop <?php while ($given = $result->fetch_array()) { ? >, how can I make the condition for the description
– Junior