<?php
require_once("messagetable.php");
try {
  $start = $db->real_escape_string($_REQUEST['start']);
  $q = $db->query("select id, UNIX_TIMESTAMP(time) as time, user, msg from message where id>$start;");
  echo json_encode($q->fetch_all(MYSQLI_ASSOC));
} catch (Exception $e) {
  echo json_encode(null);
}
?>