Re: MDB2 connect failure - php5,
| From: | Mark Wiesemann | Date: | Mon, 12 Mar 2007 08:36:18 +0000 |
| Subject: | Re: MDB2 connect failure - php5, | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-26823@lists.php.net to get a copy of this message | ||
rwhartung wrote:
> Hi all - some progress.
>
> I am a newbie. I have a test database - bpsimple. I can log in from
> the command line with username minitwr and pwd RWHart (not production
> and not online).
> pear list reports:
>
> Installed packages, channel pear.php.net:
> =========================================
> Package Version State
> Archive_Tar 1.3.1 stable
> Console_Getopt 1.2 stable
> DB 1.7.6 stable
> MDB2 2.3.0 stable
> MDB2_Driver_pgsql 1.3.0 stable
> PEAR 1.4.9 stable
> XML_RPC 1.5.0 stable
>
> require_once 'MDB2.php' ;
> $dsn = "pgsql://minitwr:XXX@localhost/bpsimple" ;
> $mdb2 =& MDB2::connect($dsn) ;
> if (PEAR::isError($mdb2) )
> {
> die( "Error Reported: " . $mdb2->getMessage() . "\n"."<br
> />" ) ;
> }
> print "ERROR REPORTED: " . $errorReported ."\n" . "<br/>" ;
This line of code will give you a more reasonable error message:
die( "Error Reported: " . $mdb2->getMessage() . ', ' .
$mdb2->getDebugInfo());
BTW: There is no need to post your database password into the world.
Regards,
Mark
--
http://www.markwiesemann.eu