PHP 8.1.28 Released!

Session::createSchema

(No version information available, might only be in Git)

Session::createSchema新しいスキーマを作成する

説明

public mysql_xdevapi\Session::createSchema(string $schema_name): mysql_xdevapi\Schema

 新しいスキーマを作成します。

パラメータ

schema_name

作成するスキーマの名前

戻り値

成功した場合はスキーマオブジェクトを返します。 失敗した場合は例外がスローされます。

例1 mysql_xdevapi\Session::createSchema() の例

<?php
$uri
= 'mysqlx://happyuser:password@127.0.0.1:33060/';
$sess = mysql_xdevapi\getSession($uri);

try {

if (
$schema = $sess->createSchema('fruit')) {
echo
"Info: I created a schema named 'fruit'\n";
}

} catch (
Exception $e) {

echo
$e->getMessage();

}
?>

上の例の出力は、 たとえば以下のようになります。

Info: I created a schema named 'fruit'
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top