Join Up!
104882 members and counting!

 
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links 
search for in the  
previousmysql_data_seekmysql_db_querynext
Last updated: Tue, 29 Oct 2002
view the printer friendly version or the printer friendly version with notes or change language to Czech | Finnish | German

mysql_db_name

(PHP 3>= 3.0.6, PHP 4 )

mysql_db_name -- Get result data

Description

string mysql_db_name ( resource result, int row [, mixed field])

mysql_db_name() takes as its first parameter the result pointer from a call to mysql_list_dbs(). The row parameter is an index into the result set.

If an error occurs, FALSE is returned. Use mysql_errno() and mysql_error() to determine the nature of the error.

Ejemplo 1. mysql_db_name() example

<?php
    error_reporting(E_ALL);

    mysql_connect('dbhost', 'username', 'password');
    $db_list = mysql_list_dbs();

    $i = 0;
    $cnt = mysql_num_rows($db_list);
    while ($i < $cnt) {
        echo mysql_db_name($db_list, $i) . "\n";
        $i++;
    }
?>

For backward compatibility, mysql_dbname() is also accepted. This is deprecated, however.

User Contributed Notes
mysql_db_name
add a note about notes
There are no user contributed notes for this page.
previousmysql_data_seekmysql_db_querynext
Last updated: Tue, 29 Oct 2002
Copyright © 2001, 2002 The PHP Group
All rights reserved.
This mirror generously provided by: http://phpbuilder.com/
Last updated: Thu Oct 31 18:34:28 2002 EST