SimpleSAML\Database::exec PHP Method

exec() private method

This function queries the database without using a prepared statement.
private exec ( PDO $db, string $stmt ) : integer
$db PDO PDO object to use
$stmt string An SQL statement to execute, previously escaped.
return integer The number of rows affected.
    private function exec($db, $stmt)
    {
        assert('is_object($db)');
        assert('is_string($stmt)');
        try {
            return $db->exec($stmt);
        } catch (\PDOException $e) {
            $this->lastError = $db->errorInfo();
            throw new \Exception("Database error: " . $e->getMessage());
        }
    }