2
$consulta = "SELECT * FROM `teste` WHERE id='1' ";
<div class="box-header">
<h2><?php while($d = $con->fetch_array()){ ?>
<?php echo $d["cnpj_cpf_tab_clientes"];?>
<?php echo $d["telefone_tab_clientes"];?>
<?php } ?></h2>
</div>
<!-- /.box-header -->
<div class="box-body">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead><tr>
<th>CNPJ</th>
<th>Telefone</th>
</tr>
</thead>
<tbody>
<?php while($dado = $con->fetch_array()){ ?>
<tr>
<td><?php echo $dado["cnpj_cpf_tab_clientes"];?></td>
<td><?php echo $dado["telefone_tab_clientes"];?></td>
</tr>
<?php } ?>
</tbody>
</table>
<h2>Endereço</h2>
</div>
Because the second while($dado..)
no results return for me?
Because the resultset has already been exhausted in the first while (if they are the same)
– rray
They’re the same. You can help me how I can fix this?
– Junior
You can do while 1x by adding the data to an array, and then later you can call them using a foreach in this new array
– Leo Letto
I get it, I’ll research how to use foreach, thanks
– Junior
I made a test in my database and the way it’s in my answer is working round!
– user60252
@Junior, if you want an example, I’ll make it for you
– Leo Letto