Re: Connection issues with pgsql?
| From: | Nathaniel Price | Date: | Fri, 28 Mar 2003 21:47:02 +0000 |
| Subject: | Re: Connection issues with pgsql? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-26683@lists.php.net to get a copy of this message | ||
OOPS! /me hangs head in shame...
That's what it was. Guess that's what I get for always using PHPlib's
abstraction layer... I hardly ever use the actual pg_*() functions anymore.
Thanks for putting up with me. ;)
________________________________________
Nathaniel Price http://www.thornvalley.com
"Who is General Failure and why is he reading my hard drive?"
----- Original Message -----
From: "Jennifer Goodie" <goodie@apollointeractive.com>
To: "Nathaniel Price" <seoman@thornvalley.com>; <php-db@lists.php.net>
Sent: Friday, March 28, 2003 1:27 PM
Subject: RE: [PHP-DB] Connection issues with pgsql?
> Check the documentation on pg_query.
> http://www.php.net/manual/en/function.pg-query.php
>
> It expects the link identifier as the first argument and the query as the
> second. Switch your arguments and you might have some luck.
>
> The manual is always a great place to look for answers to things like
this.
>
> -----Original Message-----
> From: Nathaniel Price [mailto:seoman@myrealbox.com]
> Sent: Friday, March 28, 2003 11:05 AM
> To: php-db@lists.php.net
> 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:
> <?php
> error_reporting (E_ALL);
> $myconn = pg_connect("dbname=thornvalley");
> $res = pg_query('select * from test;', $myconn);
> print_r(pg_fetch_row($res));
> ?>
>
> 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
>
>
>