Original MySQL API (
Mysql
)
2253
$link = mysql_connect('dbhost', 'username', 'password');
$db_list = mysql_list_dbs($link);
$i = 0;
$cnt = mysql_num_rows($db_list);
while ($i < $cnt) {
echo mysql_db_name($db_list, $i) . "\n";
$i++;
}
?>
Notes
Note
For backward compatibility, the following deprecated alias may be used:
mysql_dbname
See Also
mysql_list_dbs
mysql_tablename
20.7.2.5.8.
mysql_db_query
Copyright 1997-2012 the PHP Documentation Group. [2230]
•
mysql_db_query
Selects a database and executes a query on it
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:
mysqli_select_db
then the query
PDO::__construct
Description
resource mysql_db_query(
string database,
string query,
resource link_identifier
= =NULL);
mysql_db_query
selects a database, and executes a query on it.
Warning
This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature
is highly discouraged.
Parameters
database
The name of the database that will be selected.
query
The MySQL query.
Data inside the query should be
properly escaped
.
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 ...