|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-23 09:18 UTC] sniper@php.net
[2005-11-24 06:22 UTC] sdb at mail dot chita dot ru
[2005-11-24 09:24 UTC] sniper@php.net
[2005-11-24 09:36 UTC] sdb at mail dot chita dot ru
[2005-11-24 13:28 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 23:00:01 2025 UTC |
Description: ------------ My script successfully connects to oracle, parse and execute simple query (select * from some_table). Functions oci_fetch_assoc, oci_fetch_array, oci_fetch_row does not return an array. When I try to do "each" with returned array, PHP prints "Variable passed to each() is not an array or object" oci_num_fields returns right count of columns in result and oci_field_name returns right column names in loop. Function oci_fetch_all works good, it returns result (array of fields and values), that I expect. Reproduce code: --------------- $c=oci_new_connect("a", "b" , "c", "AMERICAN_AMERICA.CL8MSWIN1251"); $s = oci_parse($c, "SELECT NAME from ABONENT"); if (oci_execute($s, OCI_DEFAULT)) { while($a=oci_fetch_assoc($s)) { while (list($key, $val) = each($a)) { echo $key." = ".$val."<br>"; }; }; }; Expected result: ---------------- Something like that: NAME = aaa NAME = bbb ... Actual result: -------------- Warning: Variable passed to each() is not an array or object in /var/www/test3.php on line 27