Re: php + postgresql

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: php + postgresql
Date: 2008-07-24 11:08:54
Message-ID: 20080724130854.0dbe7301@dawn.webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 24 Jul 2008 12:30:22 +0200
"Leif B. Kristensen" <leif(at)solumslekt(dot)org> wrote:

> On Thursday 24. July 2008, admin wrote:

> >while ($row = pg_fetch_array($query)) {
> > $content = $row[0]
> >}
> >
> >echo $content;
> >
> >$content was always 'undeclared'.
>
> You have to use an intermediate variable like a handle. Try this:
>
> $handle = pg_query("SELECT whatever FROM foo");
> while ($row = pg_fetch_array($handle) {
> $content = $row[0];
> }

ivan(at)dawn:~$ php -a
Interactive mode enabled

<?php
echo pg_fetch_array($pippo);

Warning: pg_fetch_array() expects parameter 1 to be resource, null
given in /home/ivan/- on line 2

Call Stack:
18.3923 1079256 1. {main}() /home/ivan/-:0
18.3924 1079528 2. pg_fetch_array() /home/ivan/-:2

It can't be the problem. BTW even passing a string will end up in
the same error.

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message M. François =?iso-8859-1?b?QmVub+50LU1hcmFuZA==?= 2008-07-24 11:35:08 Re: C function working with input/ouput tables failed !
Previous Message Ivan Sergio Borgonovo 2008-07-24 10:52:04 Re: php + postgresql