note 8335 deleted from function.ocibindbyname by sixd
| From: | sixd@php.net | Date: | Wed, 20 Nov 2013 19:47:01 +0000 |
| Subject: | note 8335 deleted from function.ocibindbyname by sixd | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197582@lists.php.net to get a copy of this message | ||
Note Submitter: cthrall at rocketmail dot com
----
So, if you're calling OCIBindByName in a loop and binding to an associative array like this:
<?php
while (list($key, $val) = each($array)) {
OCIBindByName($state, $key, $val['VALUE'], $val['LENGTH']);
}
?>
it won't work. My WAG is that OCI gets confused when you bind a bunch of values to what
appears to be the same variable, then call OCIExecute.
Workaround is create a new array, and copy values into it:
<?php
$value = array();
$i = 0;
while (list($key, $val) = each($array)) {
$value[$i] = $val['VALUE'];
OCIBindByName($state, $key, $value[$i], $val['LENGTH']);
$i++;
}
?>