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