pg_connection_busy
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
pg_connection_busy — 獲知連線是否為忙
說明
pg_connection_busy(resource
$connection
): bool
pg_connection_busy() 在此連線狀態為忙的時候返回 true
。如果連線狀態為忙,說明前一個查詢仍然在執行。如果呼叫 pg_get_result() 函式的話,則會被鎖死。
示例 #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';
}
?>