= 4.2.0, PHP 5, PHP 7, PHP 8)pg_connection_busy — 獲知連接是否為忙 說明pg_connection_busy(resource $connection): boolpg_connection_bus">
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
pg_connection_busy — 獲知連接是否為忙
$connection
): bool
pg_connection_busy() 在此連接狀態(tài)為忙的時候返回 true
。如果連接狀態(tài)為忙,說明前一個查詢?nèi)匀辉趫?zhí)行。如果調(diào)用 pg_get_result() 函數(shù)的話,則會被鎖死。
示例 #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';
}
?>