Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/10/2006, 04:43
nomakon
 
Fecha de Ingreso: diciembre-2005
Mensajes: 87
Antigüedad: 18 años, 4 meses
Puntos: 3
Problemas Paginacion

Tengo un problema con el siguiente codigo, me muestra las paginas pero no los resultados en la pagina siguiente y siguiente. No puedo postear links pero alguien si me envia un PM le paso la dire.


Código PHP:
<?
if (!isset($_server["PHP_SELF"])) 

$_GET $HTTP_GET_VARS
$_POST $HTTP_POST_VARS
$_SESSION $HTTP_SESSION_VARS

$sexo $_GET['sexo'];

//conexionBBDD
mysql_select_db($database$connection);

$currentPage $_SERVER["PHP_SELF"];

$registros 3;

if (!
$pagina) { 
    
$inicio 0
    
$pagina 1

else { 
     
$inicio = ($pagina 1) * $registros



?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Noticias</title>
<style>
    body { font-family: arial; font-size:12px}
</style>
</head>

<body>
    <?
    $resultados 
mysql_query("SELECT Id FROM Modelos WHERE Sexo = '$sexo' and Habilitado = 'SI'");
    
$total_registros mysql_num_rows($resultados); 
    
$resultados mysql_query("SELECT * FROM Modelos WHERE Sexo = '$sexo' and Habilitado = 'SI' ORDER BY Id ASC LIMIT $inicio, $registros");    
    
$total_paginas ceil($total_registros $registros);                       

    if(
$total_registros) {
    
        while(
$row=mysql_fetch_array($resultados)) {
    
?>
            <b><?php echo $row['ID']; ?></b><br>
            <font color='#666666'><?php echo $row['Nombre']; ?></font><br><br><br>
    <?    
        
}
        
    } else {
        echo 
"No se encontraron Modelos";
    }
    
    
mysql_free_result($resultados);                
    
    if(
$total_registros) {
        
        echo 
"<center>";
        
        if((
$_GET["pagina"] - 1) > 0) {
            echo 
"<a href='$currentPage?pagina=".($_GET["pagina"]-1)."&sexo=$sexo'>Anterior</a> ";
        }
        
        for (
$i=1$i<=$total_paginas$i++){ 
            if (
$_GET["pagina"] == $i
                echo 
"<b>".$_GET["pagina"]."</b> "
            else
                echo 
"<a href='$currentPage?pagina=$i&sexo=$sexo'>$i</a> "
        }
      
        if((
$_GET["pagina"] + 1)<=$total_paginas) {
            echo 
" <a href='$currentPage?pagina=".($_GET["pagina"]+1)."&sexo=$sexo'>Siguiente</a>";
        }
        
        echo 
"</center>";
        
    }
    
?>
</body>
</html>
Alguien me hecha una mano?

Última edición por Cluster; 11/10/2006 a las 07:26 Razón: No uses "citar" para colocar código .. mejor usa el botón "PHP" para que quede como lo ves ahora.