Re: php + postgresql

Поиск
Список
Период
Сортировка
От Leif B. Kristensen
Тема Re: php + postgresql
Дата
Msg-id 200807241230.22905.leif@solumslekt.org
обсуждение исходный текст
Ответ на php + postgresql  (admin <mick@mjhall.org>)
Ответы Re: php + postgresql  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-general
On Thursday 24. July 2008, admin wrote:

>It seems that some of PHP's PG functions have changed recently, are
>there any known issues with them?

I've been using PHP with PostgreSQL for 5 years, and haven't noticed any
substantial changes.

>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];
}

> Any pointers to good documentation covering PHP + PG, or any well
> known gotchas?

You can download my pg+php genealogy app "exodus" from here:

http://solumslekt.org/forays/exodus.tgz

The code is certainly not stellar, but it works for me. Note that the
code is intended for running in a private environment, and there are no
security features whatsoever.
--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/
My Jazz Jukebox: http://www.last.fm/user/leifbk/

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: High activity short table and locks
Следующее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: php + postgresql