<?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` > ?
AND `user_created` > NOW() - INTERVAL 7 DAY
ORDER BY `user_id`
LIMIT 10
');
$fetch->addParameter(1, $startId);
$fetch->execute();
$result = $fetch->getResult();
$sets = [];
while($result->next())
$sets[] = [
'user_id' => $result->getInteger(0),
'username' => $result->getString(1),
];
echo json_encode($sets);
} catch(Exception $ex) {
echo json_encode(['error' => 104, 'msg' => $ex->getMessage()]);
}