PHP Velho Oeste 2024

ifx_fieldtypes

(PHP 4, PHP 5 < 5.2.1)

ifx_fieldtypesInformix SQL フィールドのリスト

説明

ifx_fieldtypes ( resource $result_id ) : array

result_id のクエリについて、フィールド名をキーとし、 SQL フィールド型をデータとした連想配列を返します。

パラメータ

result_id

result_id は、 ifx_query() または ifx_prepare() (select 型のクエリのみ!) により返された有効な結果 ID です。

返り値

result_id のクエリについて、フィールド名をキーとし、 SQL フィールド型をデータとした連想配列を返します。 エラーの場合に FALSE を返します。

例1 フィールド名および SQL フィールド型

<?php
$types 
ifx_fieldtypes($resultid);
if (
is_array($types)) {
    foreach (
$types as $fname => $val) {
        echo 
"$fname:\t type = $val\n";
    }
}
?>

参考

add a note add a note

User Contributed Notes 1 note

up
0
lord_edd at hotmail dot com
22 years ago
Alternativly i found you can always do it like this using the foreach() loop...

    $types = @ifx_fieldtypes($resultid);
    if (isset($types))
    {
      foreach($types as $field_name => $data_type)
      {
         echo "{$field_name} {$data_type}";
      }
    }
To Top