Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/01/2011, 07:34
rutanga
 
Fecha de Ingreso: julio-2006
Ubicación: Concepción
Mensajes: 66
Antigüedad: 17 años, 9 meses
Puntos: 0
Comparar fechas, no imprime diferencia

Hola a todos, tengo el siguiente codigo pero no me imprime la diferencia entre las fecha, yno se que estoy haciendo mal.. si alguie n me pudisese ayudar se lo agredeceria mucho, saludos !

Código PHP:
<?
$fecha_hoy 
time();
$conexion mysql_connect("localhost","","");
    
mysql_select_db("");

    
$sql "SELECT fecha_entrega FROM cot_interna ORDER BY fecha_entrega ASC LIMIT 10";
    
$consulta mysql_query($sql,$conexion);

while (
$row mysql_fetch_array($consulta))

           {
// convierto la fecha que esta en la myqsl al mismo formato de la $fecha_hoy
        
          
$fecha_entrega_unix=strtotime("$row[fecha_entrega]");
        
        echo 
"FECHA ENTREGA UNIX: $fecha_entrega_unix";
        echo 
"FECHA HOY UNIX: $fecha_hoy </br>";


        if(
$row[fecha_entrega_unix] - $row[fecha_hoy]){

        
$diferencia$fecha_entrega_unix $fecha_hoy;
        echo 
"$diferencia";
                                            }
    }
?>

gracias!!