downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

pg_connection_reset> <pg_connect
[edit] Last updated: Fri, 18 Sep 2009

view this page in

pg_connection_busy

(PHP 4 >= 4.2.0, PHP 5)

pg_connection_busy Показва дали връзката е заета или не

Описание

bool pg_connection_busy ( resource $connection )

pg_connection_busy() установява дали връзката е заета или не. Ако е заета, това означава, че все още се изпълнява предишната заявка. Ако се използва pg_get_result() върху връзката, тя ще бъде блокирана.

Параметри

connection

Ресурс с връзката към база от данни PostgreSQL.

Връщани стойности

Връща TRUE ако връзката е заета, и FALSE - иначе.

Примери

Example #1 Пример за pg_connection_busy()

<?php
  $dbconn 
pg_connect("dbname=publisher") or die("Неуспешно свързване");
  
$bs pg_connection_busy($dbconn);
  if (
$bs) {
      echo 
'връзката е заета';
  } else {
     echo 
'връзката не е заета';
  }
?>

Вж. също



add a note add a note User Contributed Notes pg_connection_busy
levi at alliancesoftware dot com dot au 08-Nov-2009 05:00
pg_connection_busy() returning true does not necessarily mean that there are results waiting for pg_get_result(); it also stays true for some time after a query that causes any sort of postgres error. (See http://bugs.php.net/bug.php?id=36469)

 
show source | credits | stats | sitemap | contact | advertising | mirror sites