International PHP Conference Munich 2025

pg_connection_reset

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

pg_connection_reset 接続をリセット(再接続)する

説明

pg_connection_reset(PgSql\Connection $connection): bool

pg_connection_reset() は接続をリセットします。 エラーからの復旧の際に有用です。

パラメータ

connection

PgSql\Connection クラスのインスタンス。

戻り値

成功した場合に true を、失敗した場合に false を返します。

変更履歴

バージョン 説明
8.1.0 connection は、PgSql\Connection クラスのインスタンスを期待するようになりました。 これより前のバージョンでは、resource を期待していました。

例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";
}
?>

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant