get_db()->prepare(" SELECT id, name, mail, api_key, admin FROM user WHERE id = :id; "); $statement->bindValue(':id', $id, SQLITE3_TEXT); $r = $statement->execute()->fetchArray(SQLITE3_ASSOC); if ($r){ $this->id = $r["id"]; $this->name = $r["name"]; $this->mail = $r["mail"]; $this->api_key = $r["api_key"]; $this->admin = $r["admin"]; // Get all accounts $statement = get_context()->get_db()->prepare(" SELECT id FROM player WHERE user = :user "); $statement->bindValue(':user', $this->id, SQLITE3_TEXT); $q = $statement->execute(); while ($r = $q->fetchArray(SQLITE3_ASSOC)){ array_push($this->account, new Player($r["id"])); } } } } ?>