pg_connection_busy
(PHP 4 >= 4.2.0)
pg_connection_busy -- 獲知連線是否為忙
說明
bool pg_connection_busy( resource connection)
pg_connection_busy()在此連線狀態為忙的時候返回 TRUE。如果連線狀態為忙,說明前一個查詢仍然在執行。如果調用 pg_get_result()函式的話,則會被鎖死。
busy中文翻譯忙的
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';
}
?>