Re: PHP5 + Postgres 8.0.0 + pg_transaction_status

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

 



El Mar 05 Jul 2005 06:33, Jo escribió:
> 
> This sample code (as taken from de documentation):
> 
>    $dbconn = pg_connect("dbname=xxxxx host=xxx.xxx.xxx.xxx user=xxxx 
> password=xxxxxxx") or die("Could not connect");
>    $stat = pg_transaction_status($dbconn);
>    if ($stat === PGSQL_TRANSACTION_UNKNOWN) {
>       echo 'Connection is bad';
>    } else if ($stat === PGSQL_TRANSACTION_IDLE) {
>       echo 'Connection is currently idle';
>    } else {
>       echo 'Connection is in a transaction state';
>    }
> 
> produces the following error:
> 
> Fatal error: Call to undefined function pg_transaction_status() in 
> test.php on line 14

pg_connect seems to work, so I would guess (I haven't install PG8, nor PHP5 
yet) that something in the compiling didn't work properly. Maybe you should 
look for error detecting certain PG components, or see which version of libpq 
it found, and if it is the version on libpq that you installed with PG8.

You don't by the way have another version on PG installed?

> The php manual states the following:
> 
>   Not all functions are supported by all builds. It depends on your 
> libpq (The PostgreSQL C Client interface) version and how libpq is 
> compiled. If there is missing function, libpq does not support the 
> feature required for the function.

Yes, but you have the latest version of libpq (the one that comes with 
PostgreSQL 8.0.0). The only thing that can be happening is that PHP is 
finding another libpq in the way.

> I have installed Postgresql 8.0.0 from source and php 5.0.4 also from 
> source.

Update PostgreSQL to the latest 8.0.x version (lots of bugs were fixed since).


-- 
 09:33:15 up 2 days, 18:18,  1 user,  load average: 0.83, 0.70, 0.63
-----------------------------------------------------------------
Lic. Martín Marqués   | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
             Universidad Nacional
                  del Litoral
-----------------------------------------------------------------

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux