Example #1
0
 static function getClientsById($id)
 {
     openSQLConnection();
     $q = "SELECT * FROM client WHERE id = ?;";
     $rows = SQL($q, $id);
     $clients = [];
     if (!empty($rows)) {
         foreach ($rows as $name => $value) {
             $clients[] = Client::fromJSON(json_encode($value));
         }
     }
     return $clients;
 }
Example #2
0
 static function getAllUsers()
 {
     openSQLConnection();
     $q = "SELECT * FROM user;";
     $rows = SQL($q);
     $users = [];
     if (!empty($rows)) {
         foreach ($rows as $name => $value) {
             $users[] = User::fromJSON(json_encode($value));
         }
     }
     return $users;
 }