pg_connection_status
(PHP 4 >= 4.2.0, PHP 5)
pg_connection_status — 获得连接状态
<h3>说明</h3>
int <strong>pg_connection_status</strong>
( resource <code>$connection</code>
)
<p>
<strong>pg_connection_status()</strong> 返回一个连接的状态。可能的状态为
PGSQL_CONNECTION_OK 和 PGSQL_CONNECTION_BAD。
</p>
<p>
<p><strong>Example #1 <strong>pg_connection_status()</strong> 例子</strong></p>
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$stat = pg_connection_status($dbconn);
echo 'connection_status: '.$stat;
?>
</p>
<p>
<p><strong>Example #2 <strong>pg_connection_status()</strong> 例子</strong></p>
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$stat = pg_connection_status($dbconn);
echo 'connection_status: '.$stat;
?>
</p>
<p>
参见 pg_connection_busy()。
</p>