I am trying to make this query loop while value in column Producto_Prioridad = 1 in table Natan_Procesos. So, I pretty much need all the code below to loop.
<div align="center">
<div align="center" style="width: -600; -moz-box-align: center; alignment-adjust: central; alignment-baseline: central; vertical-align: central; z-index: auto;"><p> </p>
<p> Opciones de <? echo $rows['giro2']; ?></p>
<?php
try {
$sth = $db->prepare("SELECT Proveedor_Logo, Giro2_ID, Producto_Nombre, Producto_Descripcion, Producto_Precio, Producto_Imagen, Producto_Prioridad FROM Natan_Procesos WHERE Producto_Prioridad = 1");
$sth->execute(array($ead,$eac));
$row = $sth->fetch(PDO::FETCH_ASSOC);
$Proveedor_Logo = $row['Proveedor_Logo'];
$Giro2_ID = $row['Giro2_ID'];
$Producto_Nombre = $row['Producto_Nombre'];
$Producto_Descripcion = $row['Producto_Descripcion'];
$Producto_Precio = $row['Producto_Precio'];
$Producto_Imagen = $row['Producto_Imagen'];
$Producto_Prioridad = $row['Producto_Prioridad'];
} catch (PDOException $e) {
echo 'Database operation failed: ' . $e->getMessage();
}
?> </div></div>
<div align="center">
<div align="center" style="width: -600; -moz-box-align: center; alignment-adjust: central; alignment-baseline: central; vertical-align: central; z-index: auto;">
<table width="800" border="0">
<tr>
<td><input name="platofuerte" type="radio" value="" /></td>
<td width="250"><? echo "<img src='". htmlspecialchars($row['Proveedor_Logo'])."' alt='image' />" ?></td>
<td><? echo $row['Proveedor_Nombre_Comercial']; ?> </td>
<td><? echo "<img src='". htmlspecialchars($row['Producto_Imagen'])."' alt='image' />" ?> </td>
<td width="100"><? echo $row['Producto_Nombre']; ?> </td>
<td width="200"><? echo $row['Producto_Descripcion']; ?> </td>
<td width="10">$<? echo $row['Producto_Precio']; ?> </td>
</tr>
</table>
</div></div>
So far it only outputs 1 row when there are 3 rows with value =1 in column Producto_Prioridad from the same table. How do I implement the while loop to show as many rows that fulfill the condition?
Thanks for the help.