-
Tienes que buscar la fecha:
$tm = mysql_query("SELECT timestamp AS t FROM logs ORDER by id ASC")->fetch_assoc()['t']; //obviously, check the size before you fetch -
Probablemente quieras usar
strtotime()así por ejemplo:$dif = $cur_tm-strtotime($tm); -
El
$difserá en milisegundos. -
¿Qué estás haciendo con los bucles y las matrices? Demasiado confuso.