error messages (not valid postgresql link resoucre)

From: Robert Morgan <robert_(at)ihug(dot)co(dot)nz>
To: pqsl-general(at)postgresql(dot)org
Subject: error messages (not valid postgresql link resoucre)
Date: 2004-05-09 23:45:54
Message-ID: 409EC2B2.6040501@ihug.co.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

|I'm trying to run a query on a database using php and postgres functions

||<?php
db_connect();
$stat = pg_exec($connstr,"SELECT WSID from tblWorkstation ");
while ($row = pg_fetch_rows($stat))
{
print("<option> $row[0]</option>");
}
?>

but I get these error messages. I have tested to see if the connection
is still alive and it is.
||

*Warning*: pg_exec(): supplied argument is not a valid PostgreSQL link
resource in */var/www/html/Databasesite2/Untitled-2*.php on line 27 |

*Warning*: pg_fetch_row(): supplied argument is not a valid PostgreSQL
result resource in */var/www/html/Databasesite2/Untitled-2*.php on line 28

And when I try to close the connection I get theses error messages.

*Warning*: pg_close(): 1 is not a valid PostgreSQL link resource in
*/var/www/html/Databasesite2/Untitled-2.php* on line *61*

*Warning*: pg_host(): 1 is not a valid PostgreSQL link resource in
*/var/www/html/Databasesite2/Untitled-2.php* on line *63*

*Warning*: pg_last_error(): 1 is not a valid PostgreSQL link resource in
*/var/www/html/Databasesite2/Untitled-2.php* on line *64*
Failed to close connection to :

My understanding is if it is not a valid link resource that means its
not available via the connection or that connection is not open.

is this right?

Bob

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Cohen 2004-05-10 03:09:21 full tuple count in cursor.
Previous Message CSN 2004-05-09 19:08:01 alter owner on schema?