PHP 忒聊
綴豖
ヶ輛
mysql_list_dbs
(PHP 3, PHP 4)
Description
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.
瞰赽 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...
蛁: 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().
綴豖
れ萸
ヶ輛
mysql_insert_id
奻珨撰
mysql_list_fields