Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/02/2015, 05:17
Avatar de Eleazan
Eleazan
 
Fecha de Ingreso: abril-2008
Ubicación: Ibiza
Mensajes: 1.879
Antigüedad: 16 años
Puntos: 326
Respuesta: Liado en el trabajo con tiempo

Uff, vaya coñazo!

La tabla me parece errónea (yo le pondría en vez de "INICIO" y "FIN", dos campos que fueran FechaInicio, y FechaFin!), pero bueno...

mas o menos, esta es la idea

Código PHP:

$sql
->query("SELECT * FROM tablaeventos");
$tiempo 0;
while(
$inicio $sql->fetch()) {
//SUPONIENDO QUE SIEMPRE SEA UN INICIO EL PRIMER REGISTRO, Y UN FINAL EL SIGUIENTE
  
$fin $sql->fetch();
  
$tiempo += (strtotime($fin['fecha'])-strtotime($inicio['fecha']));

}
echo 
"Han pasado ".$tiempo." segundos"
No se si ves la idea ;)
__________________
>> Eleazan's Source
>> @Eleazan