(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0) oci_fetch_array — Returns the next row from a query as an associative or numeric array Descriptionoci_fetch_array(resource If For details on the data type mapping performed by the OCI8 extension, see the datatypes supported by the driver Parametersstatement A valid OCI8 statement identifier created by oci_parse() and executed by
oci_execute(), or a Can also be a statement identifier returned by oci_get_implicit_resultset(). mode An optional second parameter can be any combination of the following constants: oci_fetch_array() Modes
The default Use the addition operator "+" to specify more than one mode at a time. Return Values Returns an array with associative and/or numeric indices. If there are no more rows in the By default, Oracle's default, non-case sensitive column names will have uppercase associative indices in the result array. Case-sensitive column names will have array indices using the exact column case. Use var_dump() on the result array to verify the appropriate case to use for each query. The table name is not included in the array index. If your query contains two different columns with the same name, use ExamplesExample #1 oci_fetch_array() with
= oci_connect('hr', 'welcome', 'localhost/XE'); Example #2 oci_fetch_array() with
$row = oci_fetch_array($stid, OCI_NUM)) != false) { Example #3 oci_fetch_array() with
$row = oci_fetch_array($stid, OCI_ASSOC)) != false) { Example #4 oci_fetch_array() with
= oci_connect('hr', 'welcome', 'localhost/XE'); Example #5 oci_fetch_array() with
$row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_LOBS)) != false) { Example #6 oci_fetch_array() with case sensitive column names
Example #7 oci_fetch_array() with columns having duplicate names
$sql = 'SELECT mycity.name AS ctnm, mycountry.name Example #8 oci_fetch_array() with
= oci_connect('hr', 'welcome', 'localhost/XE'); Example #9
oci_fetch_array() with
$conn = oci_connect('hr', 'welcome', 'localhost/XE'); Example #10 Pagination with oci_fetch_array() using a
= oci_connect('hr', 'welcome', 'localhost/XE'); Example #11 oci_fetch_array() with Oracle Database Implicit Result Sets
= oci_connect('hr', 'welcome', 'localhost/pdborcl'); Notes
See Also
Maxwell_Smart at ThePentagon dot com ¶ 20 years ago
junk at netburp dot com ¶ 21 years ago
|