Gracias Okram por tu respuesta y felicitarte por esa clase q has creado pero tengo una dudida mira esta es la basica configuracion de el PHPPaging
Código php:
Ver original<?php
// Apertura de la conexión a la base de datos e Inclusión del script
// Instanciamos el objeto
$paging = new PHPPaging;
// Indicamos la consulta al objeto
$paging->agregarConsulta("SELECT * FROM usuarios ORDER BY id ASC");
// Ejecutamos la paginación
$paging->ejecutar();
// Imprimimos los resultados, para esto creamos un ciclo while
// Similar a while($datos = mysql_fetch_array($sql))
while($datos = $paging->fetchResultado()) {
echo "<tr>";
echo "<td>".$datos['id']."</td>";
echo "<td>".$datos['nombre']."</td>";
echo "<td>".$datos['apellidos']."</td>";
echo "<td>".$datos['pais']."</td>";
echo "</tr>";
}
?>
</table>
<?php
// Imprimimos la barra de navegación
echo "<b>Navegación</b>: ".$paging->fetchNavegacion();
?>
Yo segui los pasos pero tengo un duda me manejo con el
foreach ($items_noticia as $item_noticia) y tu con el while($datos = $paging->fetchResultado()) habra alguna posibilidad de manterner mi foreach y reemplazarlo por el while si es asi por favor me darias alguna opcion sino caso contrario voy a tener que cambiar mi foreach por el while No se si me hago entender
Código php:
Ver original<?php
$paging = new PHPPaging;
$paging->agregarConsulta("SELECT * FROM noticia ORDER BY id ASC");
$paging->ejecutar();
// aqui en ves del while mantener el foreach como ?
foreach ($items_noticia as $item_noticia) {
?>
<tr>
<td colspan="2" align="center"><h2><?php echo $item_noticia->titulo ?></h2></td>
</tr>
<tr>
<td align="justify" width="200" height="80"><?php echo $item_noticia->texto_corto ?></td>
</tr>
<tr>
<td colspan="2"><?php echo $item_noticia->fecha_publicacion ?> <a href="index.php?mod=noticias&pag=leer_noticia&id=<?php echo $item_noticia->id; ?> ">Leer mas..</a></td>
</tr>
<?php
echo "<b>Navegación</b>: ".$paging->fetchNavegacion();
}
?>
<tr>
<td colspan="5">Nro de Resultados:
<?php echo count($items_noticia); ?></td>
</tr>
</table>
</td>
<tr>
</table>
Gracias