I have the following code, with which I can only get the first row, the purpose is to get each row and display it in a single table
<?php
include("conexion.php");
$sql="SELECT * FROM libros ";
$res=mysqli_query($conexion,$sql);
$fieldinfo=mysqli_fetch_field_direct ($res,1);
$arreglo = array();
while($row=mysqli_fetch_array($res)){
$arreglo[] = $row;
shuffle($arreglo);
}
foreach ($arreglo as $rows){
<?php
include("conexion.php");
$sql="SELECT * FROM catalogos ";
$res=mysqli_query($conexion,$sql);
$dato1= $row[1];
$dato2=$rows[2];
$dato3=$rows[3];
$dato4=$rows[4];
}
?>
And this code must fill in the tables
<p>
<table width="657" height="71" border="1">
<tr>
<td><? echo"$dato1";?>
<p><? echo "$dato2";?></p>
<p><? echo "$dato3";?></p>
<p><? echo "$dato4";?></p>
<p><? echo "$dato5";?></td>
<td><? ?></td>
<td><? ?></td>
<td><? ?></td>
</tr>
</table>
<table width="657" height="71" border="1">
<tr>
<td><? ?></td>
<td><? ?></td>
<td><? ?></td>
<td><? ?></td>
</tr>
</table>
<table width="657" height="71" border="1">
<tr>
<td><? ?></td>
<td><? ?></td>
<td><? ?></td>
<td><? ?></td>
</tr>
</table>
the output should be something like this image