Home > Backend Development > PHP Tutorial > How to list all databases of mysql server mysql_db_name_PHP tutorial

How to list all databases of mysql server mysql_db_name_PHP tutorial

WBOY
Release: 2016-07-13 17:04:01
Original
1359 people have browsed it

How to list all databases of mysql server mysql_db_name

Definition and usage
The mysql_db_name() function takes the name of the database from which the mysql_list_dbs() function is called.

This function returns the database name on success, or FALSE on failure.

Grammar

mysql_db_name(list,row,field)
Copy after login
Copy after login
list 必需的。结果指针指定的mysql_list_dbs ( )函数
row 必需的。指定哪些行指数的结果指针返回。始于零。
field 可以,数据库名
来看看mysql_db_name的实例吧.
Copy after login
<?
Copy after login
<pre class="brush:php;toolbar:false">$db_list = mysql_list_dbs($con);
Copy after login
$i = 0;
$db_count = mysql_num_rows($db_list);
while ($i < $db_count) 
  {
  echo mysql_db_name($db_list, $i) . "<br />";
  $i++;
  }
Copy after login
?>
Copy after login
 
Copy after login
输出结果是你当前服务器的所有数据库哦.
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/630898.htmlTechArticleHow to list all databases of mysql server mysql_db_name Definition and Usage The mysql_db_name() function thinks that mysql_list_dbs is called from the database name ( ) function. This function...
Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template