php列出数据库中的所有表
2018-07-20 来源:open-open
<?php $conn = @mysql_connect( "localhost", "userName", "password" ) or die( "Sorry - could not connect to MySQL" );$rs1= mysql_list_dbs( $conn );for( $row=0; $row < mysql_num_rows( $rs1 ); $row++ )
{
$this_db = mysql_tablename( $rs1, $row );
$list .= "<b>".$this_db."</b><br />";
if( $this_db != "mysql" )
{
$rs2 = mysql_list_tables( $this_db );
for( $num=0; $num < mysql_num_rows( $rs2) ; $num++ )
{
$list .= " - " . mysql_tablename( $rs2, $num ) . "<br />";
}
}
}
?>
<html> <head>
<title>Listing Tables</title>
</head> <body>
<?php echo( $list ); ?>
</body></html>
标签: Mysql
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点!
本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。
最新资讯
热门推荐