Search Postgresql Archives

Re: php + postgresql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux