Документация PHP


pg_trace

pg_tty

PostgreSQL

PHP Manual


pg_transaction_status

(PHP 5 >= 5.1.0)

pg_transaction_status — Returns the current in-transaction status of the server.

Описание

int pg_transaction_status ( resource $connection )

Returns the current in-transaction status of the server.

Предостережение

pg_transaction_status() will give incorrect results when using a PostgreSQL 7.3 server that has the parameter autocommit set to off. The server-side autocommit feature has been deprecated and does not exist in later server versions.

Список параметров

connection

PostgreSQL database connection resource.

Возвращаемые значения

The status can be PGSQL_TRANSACTION_IDLE (currently idle), PGSQL_TRANSACTION_ACTIVE (a command is in progress), PGSQL_TRANSACTION_INTRANS (idle, in a valid transaction block), or PGSQL_TRANSACTION_INERROR (idle, in a failed transaction block). PGSQL_TRANSACTION_UNKNOWN is reported if the connection is bad. PGSQL_TRANSACTION_ACTIVE is reported only when a query has been sent to the server and not yet completed.

Примеры

Пример #1 pg_transaction_status() example

<?php
  $dbconn 
pg_connect("dbname=publisher") 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';
  }    
?>


pg_trace

pg_tty

PostgreSQL

PHP Manual

SAPE все усложнил?

MainLink - простая и прибыльная продажа ссылок!

Последние поступления:

Размещена 10 августа 2020 года

Я по ТВ видел, что через 10 лет мы будем жить лучше, чем в Германии...
Я не понял, что это они с Германией сделать хотят?!

читать далее…

ТехЗадание на Землю

Размещена 14 марта 2018 года

Пpоект Genesis (из коpпоpативной пеpеписки)

читать далее…

Шпаргалка по работе с Vim

Размещена 05 декабря 2017 года

Vim довольно мощный редактор, но работа с ним не всегда наглядна.
Например если нужно отредактировать какой-то файл например при помощи crontab, без знания специфики работы с viv никак.

читать далее…

Ошибка: Error: Cannot find a valid baseurl for repo

Размещена 13 сентабря 2017 года

Если возникает ошибка на centos 5 вида
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/

читать далее…

Linux Optimization

Размещена 30 июля 2012 года

Prelink

читать далее…