note 38376 deleted from function.ocifetchinto by sixd
| From: | sixd@php.net | Date: | Wed, 18 Nov 2009 22:51:32 +0000 |
| Subject: | note 38376 deleted from function.ocifetchinto by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163058@lists.php.net to get a copy of this message | ||
Note Submitter: Guillaume Cocatre-Zilgien
----
The use of ocifetchinto() with the OCI_ASSOC parameter is not suitable for queries with aliased
columns: the columns' real names, *not* their aliases, are used as keys in the associative
array, causing some values to be overwritten.
<?php
$sql = "select a.id, b.id from ref a, library b where a.id = b.id";
// ...parsed and executed...
ocifetchinto($stmt, $row, OCI_ASSOC);
/* print_r($row) will return only one value instead of two:
Array
(
[ID] => 948
)
*/
?>