I'm breaking my head into a problem. I hope you can help me please. I am listing all records in the database. I need to get the id of the line as the click. I'm just getting the ID of the first line, when I click on the next line the variable gives me the 1st record again.
* I took all the css and unnecessary PHp of the code to be quick and easy to understand:)
index
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Nº do Cliente</th>
<th scope="col">Nome</th>
</tr>
</thead>
<tbody>
<?php
$Mostrar = new Crud();
foreach ($Mostrar->Listar() as $rs) {
?>
<tr>
<td><?php echo $rs['cli_id']; ?></td> <!--PRECISO DESSA VARIAVEL -->
<td><?php echo $rs['cli_nome']; ?></td>
</tr>
<?php include 'includes/clientes/cadastrarMoto.php'; ?> <!--AQUI FICA O MODAL PRA APRESENTAR O ID -->
<tr>
<td colspan="6">
<div class="pull-left">
<span class="material-icons adicionar" title="Motos" data-balao="tooltip" data-toggle="modal" data-target="#cadastrarMoto">storage</span></div> <!--CLICANDO AQUI VAI PARA UM MODAL -->
</td>
</tr>
<?php
}
?>
</tbody>
</table>
registerMoto.php
<div class="modal fade">
.........
<?php echo $rs['cli_id']; ?>