Listing the Databases Available in a Connection : MySQL Connection : MySQL Database PHP Source Code


PHP Source Code » MySQL Database » MySQL Connection »

 

Listing the Databases Available in a Connection






<html>
<head>
<title>Listing the databases available in a connection</title>
</head>
<body>
<?php
$user = "navioo";
$pass = "password";
$link =  mysql_connect"mysql153.secureserver.net", $user, $pass );
if ! $link )
    die"Couldn't connect to MySQL" );

$db_res = mysql_list_dbs$link );
$num = mysql_num_rows$db_res );

for$x = 0; $x < $num; $x++ )
    print mysql_tablename$db_res, $x )."<br>";

mysql_close$link );
 ?>
</body>
</html>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo MySQL Database
» MySQL Connection