Ver Mensaje Individual
  #5 (permalink)  
Antiguo 23/07/2007, 10:51
mvlsistemas
 
Fecha de Ingreso: mayo-2004
Mensajes: 903
Antigüedad: 20 años, 8 meses
Puntos: 4
Re: Mostra tabla con resultado de consulta con 10 registros sucesivamente.

yo lo pagino asi $_pagi_cuantos = 10; ahi cambias el valor de cuantos registros mostras 10 15 20 etc.
Código PHP:
<?php include("cone.php"); ?>
<?php

$_pagi_sql 
=("SELECT hotel,estrellas,vigencia,sgl,dbl,tpl,suite,cama,adicional,htm from paquetes WHERE web ='at_web'order by hotel Asc");
//cantidad de resultados por página (opcional, por defecto 20)
$_pagi_cuantos 20
//Incluimos el script de paginación. Éste ya ejecuta la consulta automáticamente
include("paginator.inc.php");
echo 
'<table width="580" border="0" bgcolor="#993366" cellpadding="0" cellspacing="0" >';
echo
'
  <tr height="25"> 
    <td width="150" align="left"><strong><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">Argentina</font></strong></td>
    <td height="20" width="10" align = "left" > 
     <strong> 
     <font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">*</font></strong></td>
    <td width="100"  align="center"><strong><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">Vigencia</font></strong></td>
    <td width="30"align="center"><strong><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">SGL</font></strong></td>
    <td width="30" align="center"><strong><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">DBL</font></strong></td>
    <td width="30" align="center"><strong><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">TPL</font></strong></td>
    <td width="30" align="center"><strong><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">SUITE</font></strong></td>
    <td width="30" align="center"><img src="iconocama.gif" width="19" height="20"></td>
    <td width="80" align="lcenter"><strong><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">ADICIONAL</font></strong></td>
    <td width="30" align="center"><strong><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">Fotos</font></strong></td>
  </tr>'
// Así escribimos la cabecera de la tabla
while ($row mysql_fetch_array($_pagi_result)) { 

if (
$colorfila==0){
       
$color"#F4EACA";
       
$colorfila=1;
    }else{
       
$color="#FFFFE6";
       
$colorfila=0;
    }

 echo 
'<tr bgcolor='.$color.'>''<td  height="20" width="150" height="4" >'.'<strong>'.$row['hotel'].'</td>'.'</strong>'.'<td height="20" width="10" align = "left" >'.'<strong>'.$row['estrellas'].'</td>'.'</strong>'.'<td width="100"  align = "center" >'.'<strong>'.$row['vigencia'].'</td>'.'</strong>'.'<td height="20" width="30" align = "center" >'.'<strong>'.$row['sgl'].'</td>'.'</strong>'.'<td height="20" width="30"  align = "center" >'.'<strong>'.$row['dbl'].'</td>'.'</strong>'.'<td height="20" width="30" align = "center" >'.'<strong>'.$row['tpl'].'</td>'.'</strong>'.'<td width="30"  align = "center" >'.'<strong>'.$row['suite'].'</td>'.'</strong>'.'<td height="20" width="30" align = "center" >'.'<strong>'.$row['cama'].'</td>'.'</strong>'.'<td height="20" width="80" align="center">'.'<strong>'.$row['adicional'].'</td>'.'</strong>'.'<td height="20"width="30" align ="center">'.$row['htm'].'</td>'.'</tr>';

}

echo 
'</table>'// Fin de la tabla.
echo"<p>".$_pagi_navegacion."</p>";
?>

paginator.inc.php de Javier pinedo si no lo tenes te lo paso por mail. suerte