PHP5 + Postgres 8.0.0 + pg_transaction_status
| From: | Jo | Date: | Tue, 05 Jul 2005 09:33:52 +0000 |
| Subject: | PHP5 + Postgres 8.0.0 + pg_transaction_status | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-39885@lists.php.net to get a copy of this message | ||
Sorry if this was already mentioned on the list, but I couldn't find it.
One of our developpers wants to use the pg_transaction_status() command on one of our servers.
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 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. I have installed Postgresql 8.0.0 from source and php 5.0.4 also from source. so my question is: how does postgresql 8.0.x need to be compiled/installed for the pg_transaction_status() command to work? Thanks for any ideas you might have. Kind regard, Jo.