I recently left a code about how to create dynamic ids in a while
cycle.
Now I have this other doubt.
<?php
$i=1;
$n=1
while($fila=$consulta->fetch(PDO::FETCH_ASSOC))
{
$this->empleados[]=$filas;
$Filas = consult_cedula($fila['Persona']);
echo "<tr>";
echo '<td>' . $Filas['codsucursal'] . '</td>';
echo '<td>' . $fila['Persona'] . '</td>';
echo '<td>' . $fila['Fecha'] . '</td>';
echo '<td>' . $fila['Hora'] . '</td>';
echo '<td>' . $Filas['nombre'] . '</td>';
echo '<td>' . $Filas['cargo'] . '</td>';
echo '<td>' . '<input type="button" name="nom' . $n .'" id="btn"' . $i .'"" class="btn btn-danger" value="..." data-fech="' .
$fila['Fecha'] . '" data-hora="' . $fila['Hora'] . '" data-ced="' . $fila['Persona'] .
'" data-nom="' . $Filas['nombre'] . '" data-cargo="' . $Filas['cargo'] . '">';
echo "</tr>";
$i=$i+1;
$n=$n+1;
}
That's the code and as you can see, the id is already dynamic. Now, for each round the id is different, but how do I capture, for example, the second id with jQuery?
I'm allowing this query to only give me 5 results so I do not do it that long.