Im having this problem that I solve it in an ugly way. I mean, there is supposed to be a function that does that for me. What i NEED is that if the query CAN`T find any records, shows a message that says, “there are no records available”. This how I solve it for now, but I supposed there must be a better way.
while($dato2= mysql_fetch_array($query))
{
$chose = $dato2["cod_tramite"];
if ($chose != 0){ break;}
}
if ($chose == 0 )
{
echo "No se disponen registros de facturas ya pagas";
}
else
{
echo "</br>Facturas ya pagas :";
echo "<table border = '1' ><tr><th>Fecha de emision</th><th>Fecha de vencimiento</th><th>Codigo de la factura</th><th>Coste</th><th>Saldo</th></tr>" ;
while($dato= mysql_fetch_array($query))
{
echo "<tr>";
echo "<td>".$dato["fecha_emi"]."</td>" ;
echo "<td>".$dato["fecha_venc"]."</td>" ;
// echo "<td>".$dato["pago"]."</td>" ;
echo "<td>".$dato["cod_tramite"]."</td>" ;
echo "<td>".$dato["coste"]."</td>" ;
echo "<td> SALDADA </td>" ;
echo "</tr>";
}
echo "</table>";