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

Поиск
Список
Период
Сортировка
От ljb
Тема Re: Warning: Supplied argument is not a valid PostgreSQL link resource
Дата
Msg-id b3p0m7$amb$1@news.hub.org
обсуждение исходный текст
Список pgsql-general
jan@klog.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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Dennis Gearon
Дата:
Сообщение: multiple conditions in same plpglsql IF block
Следующее
От: Jean-Christian Imbeault
Дата:
Сообщение: Re: Locking rows