<?php
try
{
include_once("connection.inc.php");
include_once("mysql_database.inc.php");
$db = DBFactory::CreateDatabaseObject("MySqlDatabase");
$db->Connect($server, $database, $username, $password);
$dt = $db->Execute("SHOW DATABASES");
$content = "DATABASES:<br>";
while ($dt->MoveNext())
{
$content .= "$dt->Database<br>";
// or use:
//$content .= $dt->Field(0) . "<br>";
}
}
catch (Exception $ex)
{
$content = "Exception Caught: " . $ex->getMessage() .
"<p>Trace: " . $ex->getTraceAsString() . "</p>";
}
echo $content;
?>
|