-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabaseManager.php
More file actions
29 lines (24 loc) · 884 Bytes
/
Copy pathdatabaseManager.php
File metadata and controls
29 lines (24 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
if (array_key_exists('REQUEST_METHOD', $_SERVER) && $_SERVER['REQUEST_METHOD'] === 'GET') { exit; }
require_once 'standardDefinitions.php';
function _dbFetchAllEntries()
{
global $databasePath;
$theDatabase = new SQLite3($databasePath);
$fetchAllStatement = $theDatabase->prepare('SELECT theUsername, clientPubKey, creationDate, addressOffset, privilegeLevel FROM clientData');
$fetchAllResult = $fetchAllStatement->execute();
if ($fetchAllResult === false)
{
return null;
}
else
{
$allEntries = array();
while ($rowEntry = $fetchAllResult->fetchArray(SQLITE3_ASSOC))
{
$allEntries[] = $rowEntry; //Wtf is this, append?
}
$fetchAllStatement->close();
return $allEntries;
}
}