pg_connection_busy
(PHP 4 >= 4.2.0, PHP 5)
pg_connection_busy — 获知连接是否为忙
<h3>说明</h3>
bool <strong>pg_connection_busy</strong>
( resource <code>$connection</code>
)
<p>
<strong>pg_connection_busy()</strong> 在此连接状态为忙的时候返回 <strong><code>TRUE</code></strong>。如果连接状态为忙,说明前一个查询仍然在执行。如果调用 pg_get_result() 函数的话,则会被锁死。
</p>
<p>
<p><strong>Example #1 <strong>pg_connection_busy()</strong> 例子</strong></p>
<?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';
}
?>
</p>
<p>
参见 pg_connection_status() 和 pg_get_result()。
</p>