Документ взят из кэша поисковой машины. Адрес оригинального документа : http://old.master.cmc.msu.ru/php/function.mysql-list-dbs.html
Дата изменения: Sun Feb 3 22:47:35 2002
Дата индексирования: Tue Oct 2 08:18:35 2012
Кодировка:
mysql_list_dbs

mysql_list_dbs

(PHP 3 <= 3.0.18, PHP 4 >= 4.0.0)

mysql_list_dbs --  List databases available on a MySQL server

Description

resource mysql_list_dbs ( [resource link_identifier])

mysql_list_dbs() will return a result pointer containing the databases available from the current mysql daemon. Use the mysql_tablename() function to traverse this result pointer, or any function for result tables.

Example 1. mysql_list_dbs() example

<?php
$link = mysql_connect('localhost', 'myname', 'secret');
$db_list = mysql_list_dbs($link);

while ($row = mysql_fetch_object($db_list)) {
    echo $row->Database . "\n";
}
?>

The above example would produce the following output:
database1
database2
database3
...

Note: The above code would just as easily work with mysql_fetch_row() or other similar functions.

For downward compatibility mysql_listdbs() can also be used. This is deprecated however.

See also mysql_db_name().