0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-11-16 11:07:57 +01:00
doodle3d-connect/www/api/list.php
peteruithoven 7512b680b6 Reorganised files
Moved files meant for release to www folder
Removed old files
2014-04-24 12:09:08 +02:00

21 lines
645 B
PHP

<?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(PDO::FETCH_CLASS);
} catch (PDOException $e) {
$response = array( "status" => "error",
"msg" => $e->getMessage()." (".$e->getCode().")");
exit(json_encode($response)."\r\n");
}
$response = array( "status" => "success",
"data" => $boxes);
exit(json_encode($response)."\r\n");
?>