prepare(" select * from actor join object on actor.objectId = object.id where actor.preferredUsername = :preferredUsername "); $people_query->bindValue(':preferredUsername', $local_username); $people_query_results = $people_query->execute(); $person = $people_query_results->fetchArray(); if (!$person) { http_response_code(404); die(); } header('Content-Type: application/jrd+json; charset=utf8'); echo json_encode(array( 'subject' => "acct:$local_username@$given_domain", 'links' => array( array( 'rel'=> 'self', 'href'=> $person['url'], 'type'=> 'application/activity+json' ) ) )); $conn->close();