如题所述
第1个回答 推荐于2016-02-18
获取ppq数据库的所有表名的代码:
<?php
$server='localhost';
$user='root';
$pass='12345';
$dbname='ppq';
$conn=mysql_connect($server,$user,$pass);
if(!$conn) die("数据库系统连接失败!");
$result=mysql_list_tables($dbname);
if(!$result) die("数据库连接失败!");
while($row=mysql_fetch_row($result))
{
echo $row[0]."<br>";
}
mysql_free_result($result);
?>
mysql_list_tables
(PHP 3, PHP 4 , PHP 5)
mysql_list_tables -- 列出 MySQL 数据库中的表
说明
resource mysql_list_tables ( string database [, resource link_identifier])
mysql_list_tables() 接受一个数据库名并返回和 mysql_query() 函数很相似的一个结果指针。用 mysql_fetch_array()或者用mysql_fetch_row()来获得一个数组,数组的第0列就是数组名,当获取不到时 mysql_fetch_array()或者用mysql_fetch_row()返回 FALSE。本回答被提问者和网友采纳
<?php
$server='localhost';
$user='root';
$pass='12345';
$dbname='ppq';
$conn=mysql_connect($server,$user,$pass);
if(!$conn) die("数据库系统连接失败!");
$result=mysql_list_tables($dbname);
if(!$result) die("数据库连接失败!");
while($row=mysql_fetch_row($result))
{
echo $row[0]."<br>";
}
mysql_free_result($result);
?>
mysql_list_tables
(PHP 3, PHP 4 , PHP 5)
mysql_list_tables -- 列出 MySQL 数据库中的表
说明
resource mysql_list_tables ( string database [, resource link_identifier])
mysql_list_tables() 接受一个数据库名并返回和 mysql_query() 函数很相似的一个结果指针。用 mysql_fetch_array()或者用mysql_fetch_row()来获得一个数组,数组的第0列就是数组名,当获取不到时 mysql_fetch_array()或者用mysql_fetch_row()返回 FALSE。本回答被提问者和网友采纳
第2个回答 2015-04-27
查询 。循环展示
第3个回答 2015-04-27
数据库什么信息,这个得分情况啊!