[!--quoteo(post=322108:date=Nov 25 2005, 09:12 PM:name=neylitalo)--][div class=\'quotetop\']QUOTE(neylitalo @ Nov 25 2005, 09:12 PM) 322108[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Assign your database connection string to a variable, echo it, and let us know what the result is.
And I'm assuming that the DB library is installed by the way it generated the error.
I'm not sure what you mean by "connection string" but I rewrote to code as:
function get_db($host, $database, $user, $password){
require_once('DB.php');
$q = DB::connect("mysql://$user:$password@$host/$database");
echo "Database connection: $q<br>\n";
$q_array = get_object_vars($q);
foreach ($q_array as $k => $v){
echo "\$q[$k] = $v<br>\n";
}
echo (DB::connect("mysql://$user:$password@$host/$database"));
if (DB::isError($q)){
die($q->getMessage()." $user $password $host $database");}
return $q;
}
and it echoed out:
Database connection: Object
$q[error_message_prefix] =
$q[mode] = 1
$q[level] = 1024
$q
= -24
$q[message] = DB Error: connect failed
$q[userinfo] = [nativecode=Can't connect to MySQL server on 'localhost' (10061)] ** mysql://webreader:reading@localhost/sirentiger
$q[backtrace] = Array
$q[callback] =
ObjectDB Error: connect failed webreader reading localhost sirentiger
I'm a bit confused by what the "10061" is supposed to mean. Is that a port number? If so it's the wrong one and I'm not sure where it got that number from. If so I guess that would be the first place to look. What do you think? Thanks for your help.