array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.cubrid-db-name.php', 1 => 'cubrid_db_name', ), 'up' => array ( 0 => 'cubridmysql.cubrid.php', 1 => 'CUBRID MySQL 兼容性函数', ), 'prev' => array ( 0 => 'function.cubrid-data-seek.php', 1 => 'cubrid_data_seek', ), 'next' => array ( 0 => 'function.cubrid-errno.php', 1 => 'cubrid_errno', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/cubrid/cubridmysql/cubrid-db-name.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PECL CUBRID >= 8.3.1)
cubrid_db_name — Get db name from results of cubrid_list_dbs
Retrieve the database name from a call to cubrid_list_dbs().
Returns the database name on success, and false
on failure. If false
is returned, use cubrid_error() to determine the nature
of the error.
示例 #1 cubrid_db_name() example
<?php
error_reporting(E_ALL);
$conn = cubrid_connect('localhost', 33000, 'demodb', 'dba', '');
$db_list = cubrid_list_dbs($conn);
$i = 0;
$cnt = count($db_list);
while ($i < $cnt) {
echo cubrid_db_name($db_list, $i) . "\n";
$i++;
}
?>
以上示例会输出:
demodb