RE: [PHP-DB] ocistatement
| From: | Ford, Mike [LSS] | Date: | Fri, 05 Mar 2004 09:58:38 +0000 |
| Subject: | RE: [PHP-DB] ocistatement | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-33326@lists.php.net to get a copy of this message | ||
On 05 March 2004 09:38, Torsten Lange wrote:
> Hello,
> I receive an array from an OCIFetchStatement() and want to
> address its
> elements by indices, which fails. The original select has two columns.
> How do I have to visualize that array? I want to load it into an
> <option> list. I tried also some examples with
> while(list...), but it
> can not work until I don't know the structure.
If your column names are, say, ID and NAME, then the array looks like this:
Array ('ID' => Array ('id1', 'id2', 'id3', ...),
'NAME' => Array ('name1', 'name2', 'name3', ...)
)
So the rows of your query result are:
$arr['ID'][0], $arr['NAME'][0]
$arr['ID'][1], $arr['NAME'][1]
$arr['ID'][2], $arr['NAME'][2]
... etc. ...
HTH
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211