pg_cancel_queryとは? わかりやすく解説

Weblio 辞書 > コンピュータ > PHP関数リファレンス > pg_cancel_queryの意味・解説 

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 を返します。

例 1764. 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

    


参考

pg_send_query()
pg_connection_busy()




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「pg_cancel_query」の関連用語

pg_cancel_queryのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



pg_cancel_queryのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2024 by the PHP Documentation Group.

©2024 GRAS Group, Inc.RSS