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

search for in the

pg_connection_reset> <pg_connect
[edit] Last updated: Fri, 24 May 2013

view this page in

pg_connection_busy

(PHP 4 >= 4.2.0, PHP 5)

pg_connection_busy Verifica se a conexão está ocupada ou não

Descrição

bool pg_connection_busy ( resource $connection )

pg_connection_busy() retorna TRUE se a conexão está ocupada. Se estiver ocupada, significa que uma consulta (query) anterior ainda está sendo executada. Se pg_get_result() for chamada, será bloqueada.

Exemplo #1 pg_connection_busy() example

<?php
      $dbconn 
pg_connect("dbname=publisher") or die("Could not connect");
      
$bs pg_connection_busy($dbconn);
      if (
$bs) {
          echo 
'a conexão esta ocupada';
      }
      else {
         echo 
'a conexão não esta ocupada';
      }
  
?>

Veja também pg_connection_status() e pg_get_result().



add a note add a note User Contributed Notes pg_connection_busy - [1 notes]
up
0
levi at alliancesoftware dot com dot au
3 years ago
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