can't connect to mysql using pear
I'm having trouble with the dsn the whole page dies after printing echo('3'."<BR>"); any suggestions
<?php
require_once("/home/virtual/site110/fst/usr/share/pear/DB.php");
$user = 'cc';
$pass = '123';
$host = 'localhost';
$db_name = 'cc_org_-_1';
echo('1'."<BR>");
// Data Source Name: This is the universal connection string
$dsn = "mysql://$user:$pass@$host/$db_name";
echo('2'."<BR>");
echo($dsn."<BR>");
echo('3'."<BR>");
$db = DB::connect($dsn);
echo('4'."<BR>");
if (DB::isError($db))
{
die ($db->getMessage());
}
$res = $db->query("SELECT admin_user_name FROM cc_admin_users");
// Get each row of data on each iteration until
// there are no more rows
while ($row = $res->fetchRow())
{
$name = $row[0];
echo($name);
}
$db->disconnect();
?>
__________________
~~~~~~~~~~~~~~~~~~~~~~~
http://ebcpro.com.com
where EveryBusinessCounts
~~~~~~~~~~~~~~~~~~~~~~~
|