Home  >  Article  >  Backend Development  >  Detailed explanation of sample code for php mysql_list_dbs() function usage

Detailed explanation of sample code for php mysql_list_dbs() function usage

黄舟
黄舟Original
2017-03-30 09:14:161208browse

This article mainly introduces php mysql_list_dbs()function usage, simple This article introduces the functions of the mysql_list_dbs() function and the implementation skills of listing all mysql databases. Friends in need can refer to

. This article describes the usage of the php mysql_list_dbs() function. Share it with everyone for your reference, the details are as follows:

mysql_list_dbs() function

Definition: List all databases in the MySQL server

$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>";
}

The above is the detailed content of Detailed explanation of sample code for php mysql_list_dbs() function usage. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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