Hi, I've started to see the object-oriented programming in php and I'm doing an exercise in which I make an sql query in which I want to show all the news that I have but it generates an infinite loop of the first news that I have saved. I think it's because I'm doing a while with the query but I do not know how to fix it.
Code:
$objetoBBDD = new baseDatos();
$consulta = "SELECT * FROM noticias";
while($fila = mysqli_fetch_array($objetoBBDD->consultarBD($consulta)))
{
if($fila[4]==0)
$fila[4]="No";
else
$fila[4]="Si";
echo "Numero de la noticia: ".$fila[0]."<br> Titulo: ".$fila[1]."<br> Descripcion: ".$fila[2].
"<br> Fecha: ".$fila[3]."<br> Publicada: ".$fila[4].'<br><br>';
}