Re: Connection error - what does it mean ?
| From: | Stig S. Bakken | Date: | Thu, 31 Oct 2002 06:52:58 +0000 |
| Subject: | Re: Connection error - what does it mean ? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2574@lists.php.net to get a copy of this message | ||
On Wed, 2002-10-30 at 20:29, Henrik Stidsen wrote:
> Hi
>
> I get this error when I try to connect to a PGSQL db:
>
> Notice: DB Error: connect failed in /usr/local/lib/php/PEAR.php on
> line 593
>
> Line 593:
> 592 if ($this->mode & PEAR_ERROR_TRIGGER) {
> 593 trigger_error($this->getMessage(), $this->level);
> 594 }
>
> What does the error mean, and what to do to avoid it ?
This means that your DB::connect call failed. Check the username,
password etc. If you don't understand why it fails try this:
$dsn = "pgsql://the-dsn-you-used-above";
print_r(DB::parseDSN($dsn));
This will give you an array that looks something like this:
Array
(
[phptype] => mysql
[dbsyntax] => mysql
[username] => foo
[password] => bar
[protocol] => tcp
[hostspec] => gazonk
[port] =>
[socket] =>
[database] => db
)
If the contents don't look right, you have to fix your DSN string, or
use an array like this for connecting instead.
- Stig
--
Stig Sæther Bakken, Fast Search & Transfer ASA, Trondheim, Norway
http://pear.php.net/wishlist.php/ssb