Original MySQL API (
Mysql
)
2252
See Also
mysql_query
mysql_num_rows
mysql_fetch_row
mysql_fetch_assoc
mysql_fetch_array
mysql_fetch_object
20.7.2.5.7.
mysql_db_name
Copyright 1997-2012 the PHP Documentation Group. [2230]
•
mysql_db_name
Retrieves database name from the call to
mysql_list_dbs
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
MySQLi
or
PDO_MySQL
extension should be used. See
also
MySQL: choosing an API
guide and
related FAQ
for more information.
Alternatives to this function include:
Query:
SELECT DATABASE()
Description
string mysql_db_name(
resource result,
int row,
mixed field
= =NULL);
Retrieve the database name from a call to
mysql_list_dbs
.
Parameters
result
The result pointer from a call to
mysql_list_dbs
.
row
The index into the result set.
field
The field name.
Return Values
Returns the database name on success, and
FALSE
on failure. If
FALSE
is returned, use
mysql_error
to determine the nature of the error.
Changelog
Version
Description
5.5.0
The
mysql_list_dbs
function is deprecated,
and emits an
E_DEPRECATED
level error.
Examples
Example 20.32.
mysql_db_name
example
<?php
error_reporting(E_ALL);
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...