(PHP 4, PHP 5)
mysql_tablename — 取得表名
本扩展自 PHP 5.5.0 起已废弃,并在自 PHP 7.0.0 开始被移除。应使用 MySQLi 或 PDO_MySQL 扩展来替换之。参见 MySQL:选择 API 指南来获取更多信息。用以替代本函数的有:
SHOW TABLES$result, int $i): string|false
   从 result 中取得表名。
  
   此函数已废弃,推荐使用
   mysql_query() 函数来执行 SQL SHOW TABLES
   [FROM db_name] [LIKE 'pattern'] 替代。
  
   成功时返回表名 或者在失败时返回 false。
  
Use the mysql_tablename() function to traverse this result pointer, or any function for result tables, such as mysql_fetch_array().
| 版本 | 说明 | 
|---|---|
| 5.5.0 | mysql_tablename() 函数已废弃,调用时会抛出 E_DEPRECATED级别的错误。 | 
示例 #1 mysql_tablename() example
<?php
mysql_connect("localhost", "mysql_user", "mysql_password");
$result = mysql_list_tables("mydb");
$num_rows = mysql_num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
    echo "Table: ", mysql_tablename($result, $i), "\n";
}
mysql_free_result($result);
?>
注意:
The mysql_num_rows() function may be used to determine the number of tables in the result pointer.