array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'function.pg-connection-reset.php', 1 => 'pg_connection_reset', ), 'up' => array ( 0 => 'ref.pgsql.php', 1 => 'PostgreSQL 関数', ), 'prev' => array ( 0 => 'function.pg-connection-busy.php', 1 => 'pg_connection_busy', ), 'next' => array ( 0 => 'function.pg-connection-status.php', 1 => 'pg_connection_status', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/pgsql/functions/pg-connection-reset.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)
pg_connection_reset — 接続をリセット(再接続)する
pg_connection_reset() は接続をリセットします。 エラーからの復旧の際に有用です。
バージョン | 説明 |
---|---|
8.1.0 |
connection は、PgSql\Connection クラスのインスタンスを期待するようになりました。
これより前のバージョンでは、リソース を期待していました。
|
例1 pg_connection_reset() の例
<?php
$dbconn = pg_connect("dbname=publisher") or die("Could not connect");
$dbconn2 = pg_connection_reset($dbconn);
if ($dbconn2) {
echo "reset successful\n";
} else {
echo "reset failed\n";
}
?>