Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/06/2008, 09:05
Avatar de frasko01
frasko01
 
Fecha de Ingreso: junio-2008
Mensajes: 200
Antigüedad: 15 años, 10 meses
Puntos: 3
Respuesta: repetición de registros

Código PHP:
<?php                
$cont 
0;
$sql="SELECT fecha FROM campeonatos";
$res=mysql_query($sql,$c);
while(
$registro=mysql_fetch_array($res))
{    
    
$cont ++;
    
$este_anio explode("-",$registro['fecha']);
    if (
$anio == $este_anio[0])
    {
        if (
$cont == 1)
            echo 
"<center><hr id='hr1' /></center><ol id='seleccionado2'>&nbsp;&nbsp;&nbsp;&nbsp;".$este_anio[0]."</ol>";
        else
            echo 
"<hr id='hr2' /><ol id='seleccionado2'>&nbsp;&nbsp;&nbsp;&nbsp;".$este_anio[0]."</ol>";
    }    
    else
    {
        if (
$cont == 1)
            echo 
"<center><hr id='hr1' /></center><ol><a href='".$_SERVER['PHP_SELF']."?anio=".$este_anio[0]."' />&nbsp;&nbsp;&nbsp;&nbsp;".$este_anio[0]."</a></ol>";
        else
                echo 
"<hr id='hr2' /><ol><a href='".$_SERVER['PHP_SELF']."?anio=".$este_anio[0]."' />&nbsp;&nbsp;&nbsp;&nbsp;".$este_anio[0]."</a></ol>";
    }
}
                        
?>