From:             sdb at mail dot chita dot ru
Operating system: Red Hat Enterprise Linux AS
PHP version:      5.0.5
PHP Bug Type:     OCI8 related
Bug description:  oci_fetch_assoc or oci_fetch_array returns nothing, but 
oci_fetch_all works OK

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 bug report at http://bugs.php.net/?id=35344&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35344&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35344&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35344&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35344&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35344&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35344&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35344&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35344&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35344&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35344&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35344&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35344&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35344&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35344&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35344&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35344&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35344&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35344&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35344&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35344&r=mysqlcfg

Reply via email to