略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Session::createSchema

2025-02-27

Session::createSchema

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

Session::createSchemaCreate new schema

说明

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

Creates a new schema.

参数

schema_name

Name of the schema to create.

返回值

A Schema object on success, and emits an exception on failure.

示例

示例 #1 mysql_xdevapi\Session::createSchema() example

<?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'
添加备注

用户贡献的备注

此页面尚无用户贡献的备注。

官方地址:https://www.php.net/manual/en/mysql-xdevapi-session.createschema.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3