Mi problema es que no se como dividir la consulta para que aparezca la informacion en cada seccion.
Quiero mostrar 5 registros por cada <div class="slide"></div>
En esta seccion es donde tengo el problema.
Código PHP:
<div id="contenedor">
<h1>Ofertas</h1>
<div id="slides">
<div class="slide">
<p>
<table width="747" id="box-table-a">
<thead>
<tr>
<th width="97" scope="col" align="center">CODIGO</th>
<th width="408" scope="col" align="center">DESCRIPCION</th>
<th width="156" scope="col" align="center">COSTO</th>
<th width="156" scope="col" align="center">DESCUENTO</th>
<th width="183" scope="col" align="center">COSTO DESCUENTO</th>
</tr>
</thead>
<tbody>
<?
while($row = mysql_fetch_assoc($productos)){ ?>
<tr>
<td><? echo $row['CODIGO']; ?></td>
<td><? echo $row['DESCRIPCION']; ?></td>
<td><? echo $row['DESCUENTO']; ?></td>
<td><? echo $row['PRECIO_ORACLE']; ?></td>
<td><? echo $row["PRECIO_PROM"]; ?></td>
</tr>
<? } ?>
</tbody>
</table>
</p>
</div>
<div class="slide">
<p>Aqui quiero mostrar otros 5 registros y que se repita hasta que muestre todos los registros de la tabla</p>
</div>
</div>
Espero me puedan ayudar... pq ya llevo muchos dias intentadolo....codigo completo.
Código PHP:
<?
include("conecta.php");
$consulta="SELECT * FROM PROD_DESC";
$datos=mysql_query($consulta,$conexion);
$num_rows=mysql_num_rows($datos);
$rows_per_page= 5;
$lastpage= ceil($num_rows / $rows_per_page);
//CREO LA SENTENCIA LIMIT PARA AÑADIR A LA CONSULTA QUE DEFINITIVA
$limit= 'SELECT CODIGO, DESCRIPCION, DESCUENTO, PRECIO_ORACLE, PRECIO_PROM FROM PROD_DESC LIMIT '. $rows_per_page . ',' .$rows_per_page;
$consulta = $limit;
$productos=mysql_query($consulta);
?>
<div id="contenedor">
<h1>Ofertas</h1>
<div id="slides">
<div class="slide">
<p>
<table width="747" id="box-table-a">
<thead>
<tr>
<th width="97" scope="col" align="center">CODIGO</th>
<th width="408" scope="col" align="center">DESCRIPCION</th>
<th width="156" scope="col" align="center">COSTO</th>
<th width="156" scope="col" align="center">DESCUENTO</th>
<th width="183" scope="col" align="center">COSTO DESCUENTO</th>
</tr>
</thead>
<tbody>
<?
while($row = mysql_fetch_assoc($productos)){ ?>
<tr>
<td><? echo $row['CODIGO']; ?></td>
<td><? echo $row['DESCRIPCION']; ?></td>
<td><? echo $row['DESCUENTO']; ?></td>
<td><? echo $row['PRECIO_ORACLE']; ?></td>
<td><? echo $row["PRECIO_PROM"]; ?></td>
</tr>
<? } ?>
</tbody>
</table>
</p>
</div>
<div class="slide">
<p>Aqui quiero mostrar otros 5 registros y que repite hasta que muestre todos los registros de la tabla</p>
</div>
</div>
</div>