0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-12-25 18:13:48 +01:00
doodle3d-connect/list.php

21 lines
615 B
PHP
Raw Normal View History

<?php
require 'connect.php';
$hourago = time() - 60*60;
$remoteip = getenv('REMOTE_ADDR');
try {
$statement = $db->prepare("SELECT * FROM $table where date >= FROM_UNIXTIME(:hourago) AND remoteip = :remoteip");
$statement->execute(array( ':hourago' => $hourago,
':remoteip' => $remoteip));
$boxes = $statement->fetchAll();
} catch (PDOException $e) {
$response = array( "status" => "error",
"msg" => $e->getMessage()." (".$e->getCode().")");
exit(json_encode($response));
}
$response = array( "status" => "success",
"data" => $boxes);
exit(json_encode($response));
?>