Hola que tal soy nuevo en el foro y tengo un problema con mi paginacion,
el problema es que me muestra los resultados de la primera pagina pero en la segunda ya no muestra nada espero me puedan ayudar gracias
anexo codigo:
Código PHP:
<html>
<head>
<style type="text/css">
<!--
body {
background-image: url(imagep/fondo1.png);
}
-->
<script type=”text/javascript” src=”paging.js”></script>
</style>
</head>
<body >
<a href="buscar.html"><img src="imagep/busqueda.jpg" width="90" height="80"></a>
</body>
</html>
<?php
include("conec.php");
$link=Conectarse();
// maximo por pagina
$limit = 1;
// pagina pedida
if (isset($_GET['pag'])){
$pag = (int) $_GET["pag"];
if ($pag < 1){
$pag = 1;
}
}else{
$pag = 1;
}
$offset = ($pag-1) * $limit;
$c1= $_REQUEST['comida'];
$l1= $_REQUEST['lugar'];
$result= mysql_query ("SELECT SQL_CALC_FOUND_ROWS * from restaurante1 where tipo_comida= '".$c1."' and lugar= '".$l1."' LIMIT ".$offset.",".$limit.";",$link);
$sqlTotal = mysql_query ("select FOUND_ROWS() as total");
$rowTotal = mysql_fetch_assoc($sqlTotal);
// Total de registros sin limit
$total = $rowTotal["total"];
while ($row = mysql_fetch_row($result)){
echo "<table border = '0' > ";
echo "<tr> ";
echo "<td> ";
echo "<img src='imagep/come aqui.png' width='100' height='90'>";
echo "</td> ";
echo "<td width='170'><a href='$row[2].html'>$row[1]</a></td>";
echo "</tr> ";
echo "<tr> ";
echo "<td width='200'>Precio Aprox.$row[4] Por Persona</td>";
echo "<td> Lugar $row[5]</td>";
echo "<td>Comida $row[3]</td>";
echo "</tr> ";
echo "</table> ";
//echo "<center>";
echo "<table border = '0' > ";
echo "<tr width='351'> ";
echo "<td>
<img src='imagep/card.png' alt='Forma de Pago' onmouseover='this.width=70;this.height=70;' onmouseout='this.width=50;this.height=50;' width='50' height='50'>
<img src='imagep/estacionamiento.png' alt='Estacionamiento' onmouseover='this.width=70;this.height=70;' onmouseout='this.width=50;this.height=50;' width='50' height='50'>
<img src='imagep/ejecutivo.png' alt='Sala de Juntas' onmouseover='this.width=70;this.height=70;' onmouseout='this.width=50;this.height=50;' width='50' height='50'>
<img src='imagep/familia.png' alt='Sala Familiar' onmouseover='this.width=70;this.height=70;' onmouseout='this.width=50;this.height=50;' width='50' height='50'>
<img src='imagep/music.png' alt='Musica en vivo' onmouseover='this.width=70;this.height=70;' onmouseout='this.width=50;this.height=50;' width='50' height='50'>
<img src='imagep/valet parking.png' alt='Valet Parking' onmouseover='this.width=70;this.height=70;' onmouseout='this.width=50;this.height=50;' width='50' height='50'>
<img src='imagep/wife.png' alt='Internet Inalambrico' onmouseover='this.width=70;this.height=70;' onmouseout='this.width=50;this.height=50;' width='50' height='50'></td>";
echo "</tr> ";
echo "</center>";
}
?>
<?php
$totalPag = ceil($total/$limit);
$links = array();
for( $i=1; $i<=$totalPag ; $i++)
{
$links[] = '<a href="mostrar1.php?pag='.$i.'">'.$i.'</a>';
}
echo implode(" - ", $links);
?>