/** * Prepare an SQL statement for execution. * * @param string The SQL statement to prepare. */ protected final function prepare($query) { if ($this->database === NULL) { return $this->errorMessage("No database connection found."); } $this->database->prepare($query); }
protected function getUserPermissions($userID) { $sqlQuery = "SELECT permission FROM Users WHERE id = :id LIMIT 1"; $sqlParam = array("id" => $userID); $this->database->prepare($sqlQuery); $this->database->execute($sqlParam); $response = $this->database->fetch(); return isset($response['permission']) ? $response['permission'] : FALSE; }