Table of Contents

Syntax

string mysql_db_name(resource $result, in $rowno [, mixed $field])

(PHP 4, PHP 5)

$result The query result from a call to the function: mysql_list_dbs.
$rowno Offset to the row number to navigate to. This number must be between 0 and rowcount - 1.
$field The name of the field to retrieve.
RETURNS The name of the database on success, or false when an error occurs.

What it Does

Retrieves the name of a database from the results set ($result) of a call to mysql_list_dbs. The result is a list of all databases that are available to the user on the MySQL database server.

Example

// open the mysql resource
$res = mysql_connect($server, $user, $pass);
 
// retrieve the list of databases from the server
$databases = mysql_list_dbs();
 
// get the first database name
	echo 'Database(0) = ' . mysql_db_name($databases, 0);
 
mysql_db_name.txt · Last modified: 2008/04/18 14:00 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki