array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.pg-connection-busy.php', 1 => 'pg_connection_busy', ), 'up' => array ( 0 => 'ref.pgsql.php', 1 => 'PostgreSQL 函数', ), 'prev' => array ( 0 => 'function.pg-connect.php', 1 => 'pg_connect', ), 'next' => array ( 0 => 'function.pg-connection-reset.php', 1 => 'pg_connection_reset', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'zh', 'path' => 'reference/pgsql/functions/pg-connection-busy.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
pg_connection_busy — 获取连接是否繁忙
pg_connection_busy() 确定连接是否繁忙。如果繁忙,则之前的查询仍在执行。如果在连接上使用 pg_get_result(),将被阻塞。
版本 | 说明 |
---|---|
8.1.0 |
现在 connection 参数接受 PgSql\Connection
实例,之前接受 resource。
|
示例 #1 pg_connection_busy() 示例
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$bs = pg_connection_busy($dbconn);
if ($bs) {
echo 'connection is busy';
} else {
echo 'connection is not busy';
}
?>