Unlike mysql_fetch_assoc, all indexes of associative array are upper-case.
so, use
$row = ibase_fetch_assoc($result);
echo $row["INDEX"];
not
echo $row["index"];
ibase_fetch_assoc
(PHP 4 >= 4.3.0, PHP 5)
ibase_fetch_assoc — クエリの結果から、行を連想配列として取得する
説明
array ibase_fetch_assoc
( resource $result
[, int $fetch_flag = 0
] )
クエリの結果の行を連想配列で返します。
ibase_fetch_assoc() は、 result から結果を 1 行取得します。 同じフィールド名のカラムが 2 つ以上存在する場合、最後のカラムが 優先されます。同名のその他のカラムにアクセスするには、 ibase_fetch_row() を使用して数値添字を用いるか あるいはクエリ中でカラムに別名をつけます。
パラメータ
- result
-
結果ハンドル。
- fetch_flag
-
fetch_flag は、定数 IBASE_TEXT および IBASE_UNIXTIME を論理和で指定します。IBASE_TEXT を渡すと、BLOB ID のかわりに BLOB の内容自体を返します。IBASE_UNIXTIME を渡すと、日付/時刻の値を文字列ではなく Unix タイムスタンプで返します。
返り値
ibase_fetch_assoc() は、取得した行に対応する連想配列を返します。 続けてコールすると、結果セットの次の行を返し、 行がもうない場合には FALSE を返します。
参考
- ibase_fetch_row() - InterBase データベースから 1 行分の結果を取得する
- ibase_fetch_object() - InterBase データベースからオブジェクトを得る
ibase_fetch_assoc
karasek ... ceskyserver - dot - cz
26-Apr-2005 04:37
26-Apr-2005 04:37
sir_fred@
14-Dec-2003 11:34
14-Dec-2003 11:34
If your php is older than version 4.3.0, you can use the following:
$arr_record = get_object_vars(ibase_fetch_object($sql_result));
which is the same as: $arr_record = ibase_fetch_assoc($sql_result);
