ID: 35344 Updated by: [EMAIL PROTECTED] Reported By: sdb at mail dot chita dot ru -Status: Open +Status: Feedback Bug Type: OCI8 related Operating System: Red Hat Enterprise Linux AS PHP Version: 5.0.5 New Comment:
Try doing 'var_dump($a);' Previous Comments: ------------------------------------------------------------------------ [2005-11-23 07:19:35] sdb at mail dot chita dot ru 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35344&edit=1