Re: A DB::connect problem

From: Date: Thu, 23 Jun 2005 22:54:49 +0000
Subject: Re: A DB::connect problem
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19748@lists.php.net to get a copy of this message
Justin Patrin wrote: >On 6/23/05, Michael Moerz <natoka@inode.at> wrote: > > > >I haven't used pgsql myself with PEAR::DB, but perhaps this should be: >$dsn = "pgsql://user:pwd@localhost/dbname"; >or >$dsn = "pgsql://user:pwd@localhost:5432/dbname"; > > > > I've tried both and neither works. >>$dsn = "pgsql://user:pwd@unix(/tmp)/dbname"; >> >>fail with the following code: >> >>$db = DB::connect($dsn); >>if (PEAR::isError($db)) { >> die($db->getMessage()); >> >> > >You may also want to add getUserInfo() to the output here. > > > >>} >> >> I'm using now following code: (pgsql is listening on the default port) <?php error_reporting(E_ALL); require_once 'php/DB.php'; $dsn = "pgsql://user:pwd@localhost/spheres"; echo "Connecting"; $db = DB::connect($dsn); echo "Checking Errors"; if (PEAR::isError($db)) { die($db->getMessage().$db->getUserInfo()); //.$db->getDebugInfo()); } echo "Connected"; ?> Anyway the output I get now is just: Connecting So something in DB::connect() seems to go wrong, but I don't know how to debug that ... -- kind regards, Michael Moerz

« previous php.pear.general (#19748) next »