PHP Manual
后退 |  | 前进

# ocifetchinto

(PHP 3 >= 3.0.4, PHP 4, PHP 5)

ocifetchinto -- »ñÈ¡ÏÂÒ»ÐÐµ½Ò»¸öÊý×é

## ÃèÊö

int ocifetchinto ( resource stmt, array &result [, int mode] )

ocifetchinto() »ñÈ¡ SELECT µÄÏÂÒ»ÐÐµ½ result Êý×é¡£ ocifetchinto() ½«¸²¸Ç result ÒÔÇ°µÄÄÚÈÝ¡£ÔÚÄ¬ÈÏÇé¿öÏÂ£¬ result ½«º¬ÓÐËùÓÐ·Ç `NULL` ÁÐµÄÊý×é¡£¸ÃÊý×é´Ó 0 ¿ªÊ¼¼ÆÊý¡£

mode ²ÎÊýÔÊÐíÄã¸Ä±äÄ¬ÈÏµÄÐÐÎª¡£ ¿ÉÒÔ¼òµ¥µÄ½«±êÖ¾Ïà¼ÓÀ´Ê¹ÓÃ¶à¸ö±êÖ¾(ÁÐÈç£º OCI_ASSOC+OCI_RETURN_NULLS)¡£ ±êÖ¾ÁÐ±íÈçÏÂ£º

`OCI_ASSOC` ·µ»ØÒ»¸öÏà¹ØÊý×é¡£
`OCI_NUM` ·µ»ØÒ»¸ö´Ó 0 ¿ªÊ¼µÄÊý×ÖÊý×é¡£(Ä¬ÈÏÇé¿ö)
`OCI_RETURN_NULLS` ·µ»Ø¿ÕÁÐ¡£
`OCI_RETURN_LOBS` ·µ»Ø LOB µÄÖµ¶ø²»ÊÇËüµÄÃèÊö·û¡£

例子 1. Ò»¸ö¼òµ¥µÄ ocifetchinto() Àý×Ó
`<?php $conn = ocilogon("username", "password"); $query = "SELECT apples FROM oranges"; $statement = OCIParse ($conn, $query); OCIExecute ($statement); while (OCIFetchInto ($statement, $row, OCI_ASSOC)) { echo $row['apples']; } ?>`

²Î¼û ocifetch() ºÍ ociexecute()¡£

后退 | 起点 | 前进
ocifetch | 上一级 | ocifetchstatement