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_field_tell - 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_field_seekmaxdb_free_result" width="11" height="7"/>
view the version of this page
Last updated: Sun, 07 May 2006

maxdb_field_tell

(PECL)

maxdb_field_tell

(no version information, might be only in CVS)

result->current_field --  結果ポインタの現在のフィールドオフセットを取得する

説明

手続き型

int maxdb_field_tell ( resource result )

オブジェクト指向型 (プロパティ)

class result {

int current_field

}

直近の maxdb_fetch_field() コールで使用した フィールドカーソルの位置を返します。この値は、 maxdb_field_seek() の引数として使用されます。

返り値

フィールドカーソルの現在のオフセットを返します。

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

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

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

$query = "SELECT name, cno from hotel.customer ORDER BY cno";

if (
$result = $maxdb->query($query)) {

  
/* すべてのカラムのフィールド情報を取得します */
  
while ($finfo = $result->fetch_field()) {

      
/* フィールドポインタのオフセットを取得します */
      
$currentfield = $result->current_field;

      
printf("Column    %d:\n", $currentfield);
      
printf("Name:    %s\n", $finfo->name);
      
printf("Table:    %s\n", $finfo->table);
      
printf("max. Len: %d\n", $finfo->max_length);
      
printf("Flags:    %d\n", $finfo->flags);
      
printf("Type:    %d\n\n", $finfo->type);
   }   
  
$result->close();
}

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

例 2. 手続き型

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

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

$query = "SELECT name, cno from hotel.customer ORDER BY cno";

if (
$result = maxdb_query($link, $query)) {

  
/* すべてのカラムのフィールド情報を取得します */
  
while ($finfo = maxdb_fetch_field($result)) {
 
      
/* フィールドポインタのオフセットを取得します */
      
$currentfield = maxdb_field_tell($result);

      
printf("Column    %d:\n", $currentfield);
      
printf("Name:    %s\n", $finfo->name);
      
printf("Table:    %s\n", $finfo->table);
      
printf("max. Len: %d\n", $finfo->max_length);
      
printf("Flags:    %d\n", $finfo->flags);
      
printf("Type:    %d\n\n", $finfo->type);
   }
  
maxdb_free_result($result);
}

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

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

Column    1:
Name:     NAME
Table:
max. Len: 10
Flags:    -1
Type:     2

Column    2:
Name:     CNO
Table:
max. Len: 4
Flags:    -1
Type:     0


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

<maxdb_field_seekmaxdb_free_result" 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: Mon Sep 4 18:27:19 2006 JST