oci_fetch_assoc

(PHP 5)

oci_fetch_assoc -- Returns the next row from the result data as an associative array

Description

array oci_fetch_assoc ( resource statement )

oci_fetch_assoc() returns the next row from the result data as an associative array (identical to oci_fetch_array() call with OCI_ASSOC flag).

注: 本函数对 PHP NULL 值设定 NULL 字段。

A subsequent call to oci_fetch_assoc() will return the next row or FALSE if there are no more rows.

注: Oracle returns all field names in uppercase and associative indices in the result array will be uppercased too.

有关 OCI8 驱动程序执行的数据类型映射的细节,见驱动程序支持的数据类型

See also oci_fetch_array(), oci_fetch_object(), oci_fetch_row() and oci_fetch_all().


add a note add a note User Contributed Notes
24-Jul-2006 09:52
keys for oci_fetch_assoc($rsc) is case-sensitive.

Especially, if the query has an alias name, the alias name is automatically put to capital.
For example, query:

select id, sum(fee) fee
from  acct
group by id

will have keys of { 'ID', 'FEE' }
adrian dot crossley at hesa dot ac dot uk
20-Jul-2006 06:53
For earlier PHP versions use ocifetchinto with OCI_ASSOC