This repository has been archived on 2024-08-28. You can view files and clone it, but cannot push or open issues or pull requests.
satori-services/public/recent-registrations.php

24 lines
595 B
PHP
Raw Normal View History

2022-07-04 00:07:38 +00:00
<?php
require_once '_flashii.php';
$startId = (int)filter_input(INPUT_GET, 'start', FILTER_SANITIZE_NUMBER_INT);
try {
$fetch = $db->prepare('
SELECT `user_id`, `username`
FROM `msz_users`
WHERE `user_id` > :user_id
AND `user_created` > NOW() - INTERVAL 2 DAY
ORDER BY `user_id`
LIMIT 10
');
$fetch->bindValue('user_id', $startId);
if($fetch->execute())
echo json_encode($fetch->fetchAll(PDO::FETCH_ASSOC));
else
echo '[]';
} catch(PDOException $ex) {
http_response_code(500);
echo '{"error":104}';
}