PEAR script can't see DB
Posted by: rheo (---.wk.shawcable.net)
Date: September 29, 2006 08:41PM


I am trying to test PEAR with a simple script.


<?php

set_include_path(
get_include_path() .
PATH_SEPARATOR . 'c:\wamp\php\pear;'
);

require_once 'DB.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);

$db_host = 'localhost';
$db_user = 'root';
$db_pass = '';
$db_name = 'spherc_beta';
$dsn = "mysql://$db_user:$db_pass@unix+$db_host/$db_name";

$db = DB::connect($dsn);
$db->setFetchMode(DB_FETCHMODE_OBJECT);

?>

This is the same DB information that I have in my phpmysqladmin which seems to be working just fine.

But the error I get is..

DB Error: not found

any ideas?

Options: ReplyQuote
Re: PEAR script can't see DB
Posted by: CyberSpatium (67.170.181.---)
Date: September 29, 2006 09:12PM

change
$dsn = "mysql://$db_user:$db_pass@unix+$db_host/$db_name";

to
$dsn = "mysql://$db_user:$db_pass@$db_host/$db_name";

Options: ReplyQuote
Re: PEAR script can't see DB
Posted by: rheo (---.wk.shawcable.net)
Date: September 30, 2006 12:40AM


i've tried that now and no difference.

DB Error: not found

is there a path or an evironment variable maybe that needs to be set?

Options: ReplyQuote


Sorry, only registered users may post in this forum.