boundingCoordinates($radius, 'miles'); $people = $database->select('players', ['uuid', 'level', 'latitude', 'longitude', 'lastping'], ['AND' => [ 'latitude[>]' => $searchbounds[0]->getLatitudeInDegrees(), 'latitude[<]' => $searchbounds[1]->getLatitudeInDegrees(), 'longitude[>]' => $searchbounds[0]->getLongitudeInDegrees(), 'longitude[<]' => $searchbounds[1]->getLongitudeInDegrees(), '#lastping[>]' => 'DATE_SUB(NOW(), INTERVAL 5 MINUTE)'], "LIMIT" => 50 ]); var_dump($database->error()); if (!$people) { die('[]'); } for ($i = 0; $i < count($people); $i++) { $people[$i]['username'] = file_get_contents('https://sso.netsyms.com/api/getname.php?uuid=' . $people[$i]['uuid']); } echo json_encode($people);