Oracle 5.0 Reference Manual page 2273

Table of Contents

Advertisement

$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
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
Description
resource mysql_db_query(
string database,
string query,
resource link_identifier
=
=NULL);
mysql_db_query
Parameters
database
query
Original MySQL API (Mysql)
Note
For backward compatibility, the following deprecated alias may be used:
mysql_dbname
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the
future. Instead, the
MySQLi
also
MySQL: choosing an API
Alternatives to this function include:
then the query
mysqli_select_db
PDO::__construct
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.
The name of the database that will be selected.
The MySQL query.
Data inside the query should be
or
PDO_MySQL
extension should be used. See
guide and
related FAQ
2253
for more information.
properly
escaped.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents