-
日付を取得する必要があります:
$tm = mysql_query("SELECT timestamp AS t FROM logs ORDER by id ASC")->fetch_assoc()['t']; //obviously, check the size before you fetch -
おそらく
strtotime()を使用したいと思うでしょう たとえば:$dif = $cur_tm-strtotime($tm); -
$difミリ秒単位になります。 -
ループと配列で何をしていますか?混乱しすぎます。