-
Musíte vyzvednout datum:
$tm = mysql_query("SELECT timestamp AS t FROM logs ORDER by id ASC")->fetch_assoc()['t']; //obviously, check the size before you fetch -
Pravděpodobně budete chtít použít
strtotime()tak například:$dif = $cur_tm-strtotime($tm); -
$difbude v milisekundách. -
Co děláte se smyčkami a poli? Příliš matoucí.