Home > php教程 > php手册 > php获取mysql数据库中的所有表名的代码

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

WBOY
Release: 2016-06-13 12:10:12
Original
1172 people have browsed 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数据表
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template