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_cancel_query - Manual
[go: Go Back, main page]

PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<pg_affected_rowspg_client_encoding" width="11" height="7"/>
view the version of this page
Last updated: Sun, 07 May 2006

pg_cancel_query

(PHP 4 >= 4.2.0, PHP 5)

pg_cancel_query --  非同期クエリを取り消す

説明

bool pg_cancel_query ( resource connection )

pg_cancel_query() は、 pg_send_query()pg_send_query_params() あるいは pg_send_execute() により送信された非同期クエリを キャンセルします。pg_query() により実行されたクエリを キャンセルすることはできません。

パラメータ

connection

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

返り値

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

例 1. pg_cancel_query() の例

<?php
  $dbconn
= pg_connect("dbname=publisher") or die("Could not connect");

  if (!
pg_connection_busy($dbconn)) {
    
pg_send_query($dbconn, "select * from authors; select count(*) from authors;");
  }
 
 
$res1 = pg_get_result($dbconn);
  echo
"First call to pg_get_result(): $res1\n";
 
$rows1 = pg_num_rows($res1);
  echo
"$res1 has $rows1 records\n\n";
 
 
// 実行中のクエリをキャンセルする。もしまだ実行中なら、2 番目のクエリが
  // 対象となるだろう。
 
pg_cancel_query($dbconn);
?>

上の例の出力は以下となります。

First call to pg_get_result(): Resource id #3
Resource id #3 has 3 records



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

<pg_affected_rowspg_client_encoding" width="11" height="7"/>
 Last updated: Sun, 07 May 2006
show source | credits | sitemap | contact | advertising | mirror sites 
Copyright © 2001-2006 The PHP Group
All rights reserved.
This mirror generously provided by: PacketBusiness, Inc.
Last updated: Wed Jun 28 13:19:26 2006 JST