What is mysql db name in PHP

In this article I am going to explain about mysql_db_name function in PHP.
  • 1711

PHP mysql_db_name() Function

The PHP mysql_db_name function returns database name from a call to mysql_list_dbs function.

Syntax of mysql_db_name function

mysql_db_name(list, row, field)

Parameters in
mysql_db_name function

It have three  parameter:

Parameter Description
data It specifies result pointer from the mysql_list_dbs function.
row It specifies index into result set.
field It specifies the field name.

Example of mysql_db_name function







die("Could not connect:". mysql_error());


$dbList= mysql_list_dbs($con);



while($a < $count)


echo mysql_db_name($dbList, $a)."</br>";









You may also want to read these related articles :

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here


More Articles

© 2020 DotNetHeaven. All rights reserved.