Using practically the same php, except for the search part, returns the complete list, when I add the search part, one is always missing, usually the 1st of the list.
Id pac Last Name DNI 1 Alvarez Gomez Alvaro 80100105
2 Bernardez Alvarez Bernardo 80100100
3 Carles Alvarez Carlos 80100101
4 Daniels Alvaro Daniela 80100102
5 Estebanez Gomez Esteban 80100103
6 Alvarez Gomez Alejo 80100104
<?php
include('99_conn.php');
$search = '';
if (isset($_POST['search'])) {
$search = $_POST['search'];
}
$sql020 = "SELECT 00_idpac, 00_apellido, 00_nombres, 00_dni from $t00 where 00_apellido LIKE '%".$search."%' ";
if (!$res020 = $conexion->query($sql020) )
{
echo $conexion->error;
exit;
}
$fila = $res020->fetch_assoc();
if($res020->num_rows > 0){
echo "<table>";
echo "<tr>";
echo "<th>Id </th>";
echo "<th>Apellido</th>";
echo "<th>Nombres</th>";
echo "<th>DNI</th>";
echo "</tr>";
echo "<tr><th>. </th> </tr>";
while($rw020 = $res020->fetch_array()){
echo "<tr><td> </td> </tr>";
echo "<tr>";
echo "<td>" . $rw020['00_idpac'] . "</td>";
echo "<td>" . $rw020['00_apellido'] . "</td>";
echo "<td>" . $rw020['00_nombres'] . "</td>";
echo "<td>" . $rw020['00_dni'] . "</td>";
echo "</tr>";
}
echo "</table>";
}
mysqli_close($conexion);
?>
I would appreciate any guidance in this regard. 2nd question in a similar case many years ago, I could establish that if I pressed any part of the row, I would refer to another page with the id (for example, I paste a single line) as in this case the html is included in the php and not the other way around, like in the example I hit, I'm half lost. Thanks.
<td width="100"><div><a href="Gar_4_invc_liv.php?reemplazo=<?php echo $row_RS7['reemplazo']; ?>" target="_self" class="link"><?php echo $row_RS7['desc']; ?></a></div></td>