query("insert into wtagonliners (name, p_vremya_z, room) values ('$name', current_timestamp, '$room')"); } $sql->query("delete from wtagonliners where current_timestamp-p_vremya_z > '00:00:02' and room = '$room'"); // Retrieve last 20 messages from database and order them in descending order $sql->query("SELECT date, name, url, message FROM wtagshoutbox WHERE room = '$room' ORDER BY messageid DESC LIMIT 20"); include_once("response.php"); ?>