Hello, I have the following problem, I am trying to select all the records of a table and then pass them to a pdf file, the problem is that it only prints a record in the pdf, when in fact they must be 3 which are the ones that I have in the bd, I leave the code to see me in better detail.
$sql=mysqli_query($conn, "SELECT * FROM USUARIOS");
foreach($sql as $key => $value) {
$html='
<h1 align="center">Usuarios</h1><br>
<table style="font-size:13px; padding:5px 10px; border: 1px solid #666;" align="center">
<tr>
<td style="border-right: 1px solid #666;">Nombres</td>
<td style="border-right: 1px solid #666;">Apellidos</td>
<td style="border-right: 1px solid #666;">Correo</td>
<td style="border-right: 1px solid #666;">Usuario</td>
<td style="border-right: 1px solid #666;">Privilegio</td>
</tr>
<tr>
<td style="border-right: 1px solid #666; border: 1px solid #666;">'.$value["nombres"].'</td>
<td style="border-right: 1px solid #666; border: 1px solid #666;">'.$value["apellidos"].'</td>
<td style="border-right: 1px solid #666; border: 1px solid #666;">'.$value["correo"].'</td>
<td style="border-right: 1px solid #666; border: 1px solid #666;">'.$value["usuario"].'</td>
<td style="border-right: 1px solid #666; border: 1px solid #666;">'.$value["privilegio"].'</td>
</tr>
</table>';
} //Cierra foreach
$pdf->writeHTML($html, false, false, false, false, ''); //Salida PDF
$pdf->Output('reporte.pdf', 'I');
Result on screen: