Table::existsInDatabase
(사용 가능한 버전 정보가 없으며 Git에만 있을 수 있음)
Table::existsInDatabase — 데이터베이스에 테이블이 있는지 확인
설명
public mysql_xdevapi\Table::existsInDatabase(): bool
이 테이블이 데이터베이스에 존재하는지 확인합니다.
매개변수
이 함수에는 매개변수가 없습니다.
반환 값
데이터베이스에 테이블이 있으면 true
를 반환하고, 없으면 false
를 반환합니다.
Examples
예제 #1 mysql_xdevapi\Table::existsInDatabase() 예제
<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$session->sql("DROP DATABASE IF EXISTS addressbook")->execute();
$session->sql("CREATE DATABASE addressbook")->execute();
$session->sql("CREATE TABLE addressbook.names(name text, age int)")->execute();
$session->sql("INSERT INTO addressbook.names values ('John', 42), ('Sam', 33)")->execute();
$schema = $session->getSchema("addressbook");
$table = $schema->getTable("names");
if ($table->existsInDatabase()) {
echo "Yes, this table still exists in the session's schema.";
}
?>
위의 예는 다음과 유사한 결과를 출력합니다.
Yes, this table still exists in the session's schema.