2024 年 PHP 日本研討會

Table::getName

(無版本資訊,可能僅在 Git 中)

Table::getName取得表格名稱

說明

public mysql_xdevapi\Table::getName(): 字串

回傳此資料庫物件的名稱。

參數

此函式沒有參數。

回傳值

此資料庫物件的名稱。

範例

範例 #1 mysql_xdevapi\Table::getName() 範例

<?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");

var_dump($table->getName());
?>

上述範例將輸出類似以下的內容

string(5) "names"
新增註記

使用者貢獻的註記

此頁面沒有使用者貢獻的註記。
To Top