-
Devi recuperare la data:
$tm = mysql_query("SELECT timestamp AS t FROM logs ORDER by id ASC")->fetch_assoc()['t']; //obviously, check the size before you fetch -
Probabilmente vuoi usare
strtotime()quindi per esempio:$dif = $cur_tm-strtotime($tm); -
Il
$difsarà in millisecondi. -
Cosa stai facendo con i loop e gli array? Troppo confuso.