'{$datetime}' ORDER BY DATETIME ASC LIMIT 1 "; $nextresult = mysqli_query($link, $nextsql); $nextrow = mysqli_fetch_assoc($nextresult); mysqli_close($link); if($currentrow==null) return; $current_gpsid = $currentrow['gpsid']; $current_gpstype = strtoupper($currentrow['gpstype']); $current_datetimestr = $currentrow['datetimestr']; $current_datestr = $currentrow['datestr']; $current_datetimestr2 = $currentrow['datetimestr2']; $imagepath = "snapshot.php?gpstype={$current_gpstype}&gpsid={$current_gpsid}&datetimestr={$current_datetimestr}"; echo ""; echo "
"; echo ""; echo ""; if($previosrow!=null) { $previos_datetimestr2 = $previosrow['datetimestr2']; echo "

[prevois]"; } if($nextrow!=null) { $next_datetimestr2 = $nextrow['datetimestr2']; echo "

[next]"; } echo "
"; ?>