I am new to OCI and PHP and I am trying to print the data from an oracle table but I am getting an error. The error is that when printing the data of a table there is the oci_fetch_assoc function that only prints the first row of this table and I don’t really understand why. This is the code block where I try to print the data:
<?php
include("../controllers/conexion.php");
$db_connection = oci_connect($db_esquema, $db_password, $db_instance);
$stid = oci_parse($db_connection, 'SELECT * FROM PRODUCTOS ');
oci_execute($stid);
while ($fila = oci_fetch_assoc($stid)) {
echo "<tr data-id=" . $fila['IDPRODUCTO'].">";
echo "<td>". $fila['NOMBRE']."</td>";
echo "<td>". $fila['PRECIO']."</td>";
echo "<td>". $fila['DESCRIPCION']."</td>";
echo "<td>"."<a href=".'"eliminarProducto.php?id='. $fila['IDPRODUCTO'].'" class="btn btn-danger" > <i class="fas fa-trash-alt"></i></a><a href="modificarProducto.php?id=' .$fila['IDPRODUCTO'].'" class="btn btn-secondary"><i class="fas fa-marker"></i></a></td>';
echo "</tr>";
}
oci_free_statement($stid);
oci_close($db_connection);
?>
This is the output but, there is much more data in the table:
