= 4.2.0, PHP 5, PHP 7, PHP 8)pg_connection_status — 獲得連接狀態(tài) 說(shuō)明pg_connection_status(resource $connection): intpg_connection_">
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
pg_connection_status — 獲得連接狀態(tài)
$connection
): int
pg_connection_status() 返回一個(gè)連接的狀態(tài)??赡艿臓顟B(tài)為
PGSQL_CONNECTION_OK
和 PGSQL_CONNECTION_BAD
。
示例 #1 pg_connection_status() 例子
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$stat = pg_connection_status($dbconn);
echo 'connection_status: '.$stat;
?>
示例 #2 pg_connection_status() 例子
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$stat = pg_connection_status($dbconn);
echo 'connection_status: '.$stat;
?>
參見(jiàn) pg_connection_busy()。