php教程

超轻量级php框架startmvc

php mysql_list_dbs()函数用法示例

更新时间:2020-03-18 18:37 作者:startmvc
本文实例讲述了phpmysql_list_dbs()函数用法。分享给大家供大家参考,具体如下:mysql_list_dbs()

本文实例讲述了php mysql_list_dbs()函数用法。分享给大家供大家参考,具体如下:

mysql_list_dbs()函数

定义:列出MySQL服务器中所有的数据库


$conn=@mysql_connect("localhost","root","admin")or die(mysql_error());
$db=mysql_list_dbs($conn);
while($result=mysql_fetch_object($db)){
 echo $result->Database."<br>";
}

PS:这里再为大家提供2款sql在线工具供大家参考使用:

SQL在线压缩/格式化工具(包含各种常用SQL语句): http://tools.jb51.net/code/sql_format_compress

SQL代码在线格式化美化工具: http://tools.jb51.net/code/sqlcodeformat