PHP Bugs  
php.net | support | documentation | report a bug | advanced search | search howto | statistics | login

go to bug id or search bugs for  

Bug #45458 oci_fetch_all add NULL char to field name when field name is numeric
Submitted:8 Jul 2008 3:14pm UTC Modified: 28 Aug 2008 6:23am UTC
From:leopoldo dot donati at gmail dot com Assigned to:sixd
Status:Closed Category:OCI8 related
Version:5.2.6 OS:Linux RHAS4
View/Vote Developer Edit Submission

[8 Jul 2008 3:14pm UTC] leopoldo dot donati at gmail dot com
Description:
------------
Server: Oracle9i Enterprise Edition Release 9.2.0.7.0
Client: instant client 10.1.0.3

let's suppose we have a table (t) with 3 columns (a, b, c)
and you want to execute the statement:
select a "10", b "20", c "30" from t

if you parse, execute and then get the records like this:
while ($row = oci_fetch_array($statID, OCI_ASSOC)) $data[] = $row;
when you look at $data[0]["10"] there is a value

if you parse, execute and get the records with oci_fetch_all
$data = oci_fetch_all($statID, $data, 0, -1, OCI_FETCHSTATEMENT_BY_ROW)
if you print_r $data it looks the same but you can't access
$data[0]["10"] because there is a NULL after the 10 (at least trying and
ord looks like)

[8 Jul 2008 3:29pm UTC] leopoldo dot donati at gmail dot com
I meant
$nr = oci_fetch_all($statID, $data, 0, -1, OCI_FETCHSTATEMENT_BY_ROW);
[28 Aug 2008 6:23am UTC] sixd@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

----------------
Fixed in PHP 5.3

RSS feed | show source 

PHP Copyright © 2001-2009 The PHP Group
All rights reserved.
Last updated: Sat Nov 21 10:30:49 2009 UTC