PostgreSQL 函数
在线手册:中文 英文
PHP手册

pg_get_result

(PHP 4 >= 4.2.0, PHP 5)

pg_get_result 取得异步查询结果

说明

resource pg_get_result ([ resource $connection ] )

pg_get_result() 取得执行 pg_send_query() 而得到的查询结果资源。pg_send_query() 可以向 PostgreSQL 发送多个查询, pg_get_result() 则用来逐个得到查询结果。返回值为查询结果资源号。如果没有更多查询结果,则返回 FALSE


PostgreSQL 函数
在线手册:中文 英文
PHP手册
PHP手册 - N: 取得异步查询结果

用户评论:

Marko Tiikkaja (26-Oct-2008 01:14)

william at 25thandClement dot com said: "There is no way to poll/wait for a notification to come in. .."
Yes, there is. If there is a query in progress, pg_get_result() will block and return the result of that query when it's complete.

william at 25thandClement dot com (27-Jan-2005 11:03)

There is no way to poll/wait for a notification to come in. You either have to enter a busy loop or sleep. Both options are horrible. It would be nice for PHP to provide access to PQsocket so one could select() on the socket connection. This is how it's done from C or Perl.