How to list all databases of the mysql server mysql_db_name

Source: Internet
Author: User

How to list all databases of the mysql server mysql_db_name

Definition and usage
The mysql_db_name () function considers that calling the mysql_list_dbs () function from the database name.

This function returns the database name success or FALSE failure.

Syntax

Mysql_db_name (list, row, field)
  
List
Required. Mysql_list_dbs () function specified by the result Pointer
Row
Required. Specify the row indexes returned by the result pointer. It starts with zero.
Field Yes. Database name
Let's take a look at the instance of mysql_db_name.
<?
$ Db_list = mysql_list_dbs ($ con );
$ I = 0; $ db_count = mysql_num_rows ($ db_list); while ($ I <$ db_count) {echo mysql_db_name ($ db_list, $ I ). "<br/>"; $ I ++ ;}
?>
 
The output result is all the databases on your current server.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.