- 时间:2020-07-29 03:37 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:php mysql_list_dbs()函数用法示例
本文实例讲述了php mysql_list_dbs()函数用法。分享给大家供大家参考,具体如下:
[b]mysql_list_dbs()函数[/b]
[b]定义:
列出MySQL服务器中所有的数据库[/b]
$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>";
}
[b]PS:这里再为大家提供2款sql在线工具供大家参考使用:[/b]
[b]SQL在线压缩/格式化工具(包含各种常用SQL语句):
[/b][url=http://tools.1sucai.cn/code/sql_format_compress]http://tools.1sucai.cn/code/sql_format_compress[/url]
[b]SQL代码在线格式化美化工具:
[/b][url=http://tools.1sucai.cn/code/sqlcodeformat]http://tools.1sucai.cn/code/sqlcodeformat[/url]
更多关于PHP相关内容感兴趣的读者可查看本站专题:《[url=http://www.1sucai.cn/Special/84.htm]php+mysql数据库操作入门教程[/url]》、《[url=http://www.1sucai.cn/Special/768.htm]php+mysqli数据库程序设计技巧总结[/url]》、《[url=http://www.1sucai.cn/Special/43.htm]php面向对象程序设计入门教程[/url]》、《[url=http://www.1sucai.cn/Special/623.htm]PHP数组(Array)操作技巧大全[/url]》、《[url=http://www.1sucai.cn/Special/47.htm]php字符串(string)用法总结[/url]》、《[url=http://www.1sucai.cn/Special/495.htm]PHP网络编程技巧总结[/url]》及《[url=http://www.1sucai.cn/Special/231.htm]php常见数据库操作技巧汇总[/url]》
希望本文所述对大家PHP程序设计有所帮助。