PHP - Manual: cubrid_db_name
2024-12-22
(PECL CUBRID >= 8.3.1)
cubrid_db_name — Get db name from results of cubrid_list_dbs
$result
, int $index
): stringRetrieve 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
官方地址:https://www.php.net/manual/en/function.cubrid-db-name.php