10bet网址
MySQL PHP API
本手册下载
PDF (Ltr)- 2.4 mb
PDF (A4)- 2.4 mb


MySQL PHP API/.../ 模式:existsInDatabase

5.25.4模式:existsInDatabase

PHP文档组版权所有。10bet官方网站

  • 模式:existsInDatabase

    检查数据库中是否存在

描述

公共保龄球mysql_xdevapi \模式::existsInDatabase();

检查当前对象(模式、表、集合或视图)是否存在于模式对象中。

警告

这个函数目前没有文档记录;只有它的参数列表可用。

参数

这个函数没有参数。

返回值

真正的如果模式、表、集合或视图仍然存在于模式中,则else

例子

例5.102 Schema::existsInDatabase示例

< ?php $session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");$session->sql("DROP DATABASE IF EXISTS food")->execute();会话- > sql(“创建数据库食品”)- >执行();$session->sql("CREATE TABLE food.fruit(name text, rating text)")->execute();会话模式= $ - > getSchema(“食物”);模式- > createCollection(“树木”);/ /……树木= $ schema - > getCollection(“树木”);/ /…… // Is this collection still in the database (schema)? if ($trees->existsInDatabase()) { echo "Yes, the 'trees' collection is still present."; }

上面的例子将输出类似于:

是的,“树”系列仍然存在。