php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1480 assigning null columns to an array doesnt seem to work
Submitted: 1999-06-01 01:27 UTC Modified: 2006-07-17 08:50 UTC
From: svd at excitecorp dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 3.0.8 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: svd at excitecorp dot com
New email:
PHP Version: OS:

 

 [1999-06-01 01:27 UTC] svd at excitecorp dot com
this code has some unexpected behavior:

while (OCIFetchInto($stmt,$row,OCI_RETURN_LOBS)){
  reset($formq[columns]);
  while($col=each($formq[columns])){
    $retrow[$col[value]]=$row[$col[key]];
  }
  $ret[]=$retrow;
}

if ocifetchinto returns a null into $col[x], then assigning to retrow["index"] has no effect on retrow (i.e. retrow["index"] is not instantiated... doing an each over retrow will not yeild an index "index")  I assume the expected behavior should be to instantiate retrow["index"] with an empty string.

here's my workaround:
$retrow[$col[value]]=sprintf("%s",$row[$col[key]]);

php 3.0.8 is the only non-standard module compiled into my apache server 1.3.4

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-01 02:12 UTC] thies at cvs dot php dot net
this is intended behaviour!

use OCIFetchInto($stmt,$row,OCI_RETURN_LOBS|OCI_RETURN_NULLS)
to also get array entries for columns which value is NULL.

you may also specify |OCI_ASSOC to get an associative array returned!

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Mar 26 12:01:27 2019 UTC