Re: Warning: Supplied argument is not a valid PostgreSQL link resource

From: ljb <lbayuk(at)mindspring(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Warning: Supplied argument is not a valid PostgreSQL link resource
Date: 2003-03-01 00:59:51
Message-ID: b3p0m7$amb$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

jan(at)klog(dot)dk wrote:
> Hi there
>
> I get the above mentioned warning when I execute php that contacts the
> postgre database.
>
> I use the following functions to connect to db
>
> Some of the text is in danish :-)
> ...
>
> function sql_spoerg_og_faa_svar($dbcon, $query)
> {
> $resultat = pg_exec($dbcon, $query);
> $resultat_array = array();
> if(!$resultat)
> {
> echo "Kunne ikke udføre: <em>$query</em>";
=====>
> }
> while($raekke = pg_fetch_array($resultat))
> {
> $resultat_array[] = $raekke;
> }
> return $resultat_array;
> }
>
> Anyone who knows whats wrong ?

You are falling through the error and continuing with a bad result handle
up there where I put =====>. Needs a return or something.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message shahbaz 2003-03-01 01:36:33 transparent use of pre-aggregated value for very large datasets
Previous Message Dennis Gearon 2003-03-01 00:46:41 multiple conditions in same plpglsql IF block