• Start

v1 (stable)

/

Methods

use

The ->use() method for the SurrealDB SDK for PHP switches to a specific namespace and database.

Switch to a specific namespace and database. If only the ns or db property is specified, the current connection details will be used to fill the other property.

Method Syntax
$db->use([ "namespace" => "...", "database" => "..." ]);

Arguments

Description

namespace

Switches to a specific namespace.

database

Switches to a specific database.

$db->use([
    "namespace" => "surrealdb",
    "database" => "docs"
]);

Was this page helpful?