0
I’m having a problem, I have a PHP screen that shows everything from a database query.
So far everything ok, but I need to show all information without replicating the requested column.
Follow the prints.
The first is that I bring today:
The second is what I need to do:
I’m wearing a while
in PHP pulling from a Mysql database.
Follows the code:
$sql = mysqli_query($con,"SELECT
a.num_pedido,
nota_fiscal,
lote_serial,
produto,
qtd_disp-pedido qtd_disp,
lote,
unid_medida,
pedido,
a.status,
cnpj,
a.nome_cli,
a.endereco,
a.numero,
a.bairro,
a.cep_cli,
a.cidade,
cod_id,
data
from
sistemas_ag.clientes_ag a left join
sistemas_ag.agendamento_ag b on a.num_pedido = b.num_pedido
where cnpj = '".$cnpj."'
and (a.num_pedido like '%$busca%'
or nota_fiscal like '%$busca%'
or produto like '%$busca%'
or lote_serial like '%$busca%')
order by length(a.num_pedido), a.num_pedido asc")or die("erro no select verifica pedido");
boy I don’t understand what you need
– Bulfaitelo
I need to merge the information from the first column showing just once more without hiding to others. I need something to check if the value is repeated if it is shown once
– teste
the problem of hiding that in case, are different id’s, how would you treat it ? if possible put the query you used to generate this grid
– Bulfaitelo
Just use the command
DISTINCT
mysql, which will only return a single request.– Vinicius De Jesus
It is not in the query that you will change it. You will have to change it is in the display programming of this data on the screen. Where is the code?
– Rafael Barros
vese a
GROUP BY a.num_pedido
solves, at least the part of duplicated records I think will solve. But it may end up "missing" a few lines.– Neuber Oliveira