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()¡£