I'd suggest building a connection string, explicitly defining the user and
password. Maybe it would give you a more descriptive error that way
("invalid user", etc.).
The other thing I've done is do something like this:
$database = pg_connect ($conn_string)
or die ("Help! No connection to the database! Error: " .
That may give you some more diagnostic info?
> -----Original Message-----
> From: Nathaniel Price [mailto:[EMAIL PROTECTED]
> Sent: Friday, March 28, 2003 2:05 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Connection issues with pgsql?
> Hi, I just installed PHP with pgsql support, and it doesn't
> seem to work
> properly, although I don't see why it shouldn't.
> I'm running the following script:
> error_reporting (E_ALL);
> $myconn = pg_connect("dbname=thornvalley");
> $res = pg_query('select * from test;', $myconn);
> and this is what I get back:
> Warning: pg_query(): supplied argument is not a valid PostgreSQL link
> resource in /var/www/html/dbtest.php on line 4
> Warning: pg_fetch_row(): supplied argument is not a valid
> PostgreSQL result
> resource in /var/www/html/dbtest.php on line 5
> without any other clues as to what might be happening. I have
> tried using
> other connection strings as well:
> "dbname=thornvalley user=apache password=[passwd]"
> "dbname=thornvalley user=apache password=[passwd]
> host=localhost port=5432"
> with the same result.
> I'm not sure what's going on; just so that you know, I'm
> using the RPM-based
> install of Apache 2.0.44, PHP 4.3.1 and PostgreSQL 7.3.2 that
> comes with
> Mandrake Linux 9.1. All of the necessary support packages
> (AFAIK) have been
> installed and are visible with phpinfo() (i.e. there's a
> pgsql section), and
> I have defined an apache user in the PostgreSQL database...
> so, any clues as
> to what might be going on?
> Nathaniel Price http://www.thornvalley.com
> "Who is General Failure and why is he reading my hard drive?"
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php