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: maxdb_use_result - 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

maxdb_warning_count" width="11" height="7"/> <maxdb_thread_safe
Last updated: Wed, 01 Nov 2006
view this page in

maxdb_use_result

(PECL)

maxdb_use_result

(no version information, might be only in CVS)

maxdb->use_result -- 結果セットの取得を開始する

説明

手続き型

resource maxdb_use_result ( resource link )

オブジェクト指向型 (メソッド)

class maxdb {

resource use_result ( void )

}

maxdb_use_result() は何の動作もしません。

返り値

結果、あるいはエラー時に FALSE を返します。

例 1. オブジェクト指向型

<?php
$maxdb
= new maxdb("localhost", "MONA", "RED", "DEMODB");

/* 接続を調べます */
if (maxdb_connect_errno()) {
  
printf("接続に失敗しました: %s\n", maxdb_connect_error());
   exit();
}

$query  = "SELECT * FROM DUAL";

/* 複数クエリを実行します */
if ($maxdb->multi_query($query)) {
   do {
      
/* 最初の結果セットを保存します */
      
if ($result = $maxdb->use_result()) {
           while (
$row = $result->fetch_row()) {
              
printf("%s\n", $row[0]);
           }
          
$result->close();
       }
      
/* 区切りを表示します */
      
if ($maxdb->more_results()) {
          
printf("-----------------\n");
       }
   } while (
$maxdb->next_result());
}

/* 接続を閉じます */
$maxdb->close();
?>

例 2. 手続き型

<?php
$link
= maxdb_connect("localhost", "MONA", "RED", "DEMODB");

/* 接続を調べます */
if (maxdb_connect_errno()) {
  
printf("接続に失敗しました: %s\n", maxdb_connect_error());
   exit();
}

$query  = "SELECT * FROM DUAL";

/* 複数クエリを実行します */
if (maxdb_multi_query($link, $query)) {
   do {
      
/* 最初の結果セットを保存します */
      
if ($result = maxdb_use_result($link)) {
           while (
$row = maxdb_fetch_row($result)) {
              
printf("%s\n", $row[0]);
           }
          
maxdb_free_result($result);
       }
      
/* 区切りを表示します */
      
if (maxdb_more_results($link)) {
          
printf("-----------------\n");
       }
   } while (
maxdb_next_result($link));
}

/* 接続を閉じます */
maxdb_close($link);
?>

上の例の出力は、たとえば以下のようになります。

a


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

 
show source | credits | sitemap | contact | advertising | mirror sites