Join Up!
96806 members and counting!

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

mysql_list_dbs

(PHP 3, 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.

Esimerkki 1. mysql_list_dbs() example

<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$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
...

Huomaa: 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().

User Contributed Notes
mysql_list_dbs
add a note about notes
There are no user contributed notes for this page.
previousmysql_insert_idmysql_list_fieldsnext
Last updated: Tue, 28 May 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