>I have problem when I try to retrieval the data from Oracle database.
>what I want is to put each row of data into an array with second column
>value as the key and first column as the value, at present I can not
>append the value to the existing array instead replacing current array
>value, can any people how can I fix it , sorry I am pretty new to PHP,
>thank you in advance.

Each time you iterate through the while loop, you are overwriting your old
results with new ones. Try something like the following (note the '[]'
near the end):

        $results = array();

        while(ora_fetch_into($cursor, $result, ORA_FETCHINTO_ASSOC))
            if(is_array($result))
                $results[] = $result;

        print_r($results)

Read more in "square bracket syntax" at
http://www.php.net/manual/en/language.types.array.php


---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to