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_get_notify - 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_get_pid" width="11" height="7"/> <pg_free_result
Last updated: Sun, 25 Nov 2007

view this page in

pg_get_notify

(PHP 4 >= 4.3.0, PHP 5)

pg_get_notify — SQL NOTIFY メッセージを取得する

説明

array pg_get_notify ( resource $connection [, int $result_type ] )

pg_get_notify()は、NOTIFY SQL コマンドにより送信された通知メッセージを取得します。 通知メッセージを取得するには、LISTEN SQL コマンドを発行する必要があります。

パラメータ

connection

PostgreSQL データベースの接続リソース。

result_type

result_type は、返り値の形式を制御する オプションのパラメータです。result_type は定数であり、次の値のどれかとすることが可能です。 PGSQL_ASSOCPGSQL_NUM および PGSQL_BOTHPGSQL_NUM を使用すると、pg_get_notify() は数値添字の配列を返します。また、PGSQL_ASSOC を使用すると連想配列形式で返します。PGSQL_BOTH がデフォルト設定で、これは数値添字の配列と連想配列の両方を返します。

返り値

NOTIFY メッセージ名とバックエンドの PID を含む 配列を返します。もし待ち受ける NOTIFY が存在しない 場合は then FALSE を返します。

Example#1 PostgreSQL NOTIFY メッセージ

<?php 
$conn 
pg_pconnect("dbname=publisher");
if (!
$conn) {
  echo 
"An error occured.\n";
  exit;
}

// 他のプロセスからの 'author_updated' メッセージを監視する
pg_query($conn'LISTEN author_updated;');
$notify pg_get_notify($conn);
if (!
$notify) {
  echo 
"No messages\n";
} else {
  
print_r($notify);
}
?>

参考



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

pg_get_pid" width="11" height="7"/> <pg_free_result
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites