Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: pg_ping - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

pg_port" width="11" height="7"/> <pg_pconnect
Last updated: Mon, 05 Feb 2007

view this page in

pg_ping

(PHP 4 >= 4.3.0, PHP 5)

pg_ping — データベース接続を調べる

説明

bool pg_ping ( [resource connection] )

pg_ping() はデータベース接続を調べ、その接続が 壊れている場合には再度接続を試みます。

パラメータ

connection

PostgreSQL データベース接続リソース。connection が指定されていない場合はデフォルトの接続が使用されます。 デフォルトの接続は、直近の pg_connect() あるいは pg_pconnect() によって作成されたものです。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例 1821. pg_ping() の例

<?php
$conn
= pg_pconnect("dbname=publisher");
if (!
$conn) {
  echo
"エラーが発生しました。\n";
  exit;
}

if (!
pg_ping($conn))
  die(
"接続は壊れています。\n");
?>

参考

pg_connection_status()
pg_connection_reset()



add a note add a note User Contributed Notes
pg_ping
There are no user contributed notes for this page.

pg_port" width="11" height="7"/> <pg_pconnect
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites