Problem connecting to database.
| From: | Sean Chambers | Date: | Tue, 02 Jul 2002 13:19:09 +0000 |
| Subject: | Problem connecting to database. | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-1786@lists.php.net to get a copy of this message | ||
System stats:
MySQL with PHP 4.1 on redhat 7.2
PHP is running as cgi; not as an apache module
Here is the problem I am having:
I can connect fine using the following:
$conn = mysql_connect($db_host,$db_user,$db_pass);
if (!$conn) {
echo mysql_error();
}
But when I attempt to do the following it tells me: DB Error: not found
$dsn = $db_type.'://'.$db_user.':'.$db_pass.'@'. $db_host
..'/'.$db_name;
$db = DB::Connect($dsn);
if (DB::isError($db)) {
die ($db->getMessage());
}
$db->setFetchMode(DB_FETCHMODE_ASSOC);
Does anyone know why this would be happening? Do I need to change
something in DB.php and PEAR.php because php is running as cgi?
Sean Chambers
Web Developer
Vann Data Technology Centre
Daytona Beach, FL
(386) 238-1200 ext. 1205
chamberss@vanndata.com