当前位置: 移动技术网 > IT编程>开发语言>PHP > php获取mysql数据库中的所有表名的代码

php获取mysql数据库中的所有表名的代码

2019年04月22日  | 移动技术网IT编程  | 我要评论
复制代码 代码如下:

$server = 'localhost';
$user = 'root';
$pass = '';
$dbname = 'dayanmei_com';
$conn = mysql_connect($server,$user,$pass);
if(!$conn) die("数据库系统连接失败!");
mysql_select_db($dbname) or die("数据库连接失败!");
$result = mysql_query("show tables");
while($row = mysql_fetch_array($result))
{
echo $row[0]."";
}
mysql_free_result($result);

注意php中列表mysql中所有表名的函数mysql_list_tables,已经删除了,建议不要使用该函数列表mysql数据表

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网