note 8335 added to OCIBindByName
| From: | cthrall at rocketmail dot com | Date: | Wed, 06 Sep 2000 21:40:21 +0000 |
| Subject: | note 8335 added to OCIBindByName | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4266@lists.php.net to get a copy of this message | ||
So, if you're calling OCIBindByName in a loop and binding to an associative array like this:
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:
$value = array();
$i = 0;
while (list($key, $val) = each($array))
{
$value[$i] = $val['VALUE'];
OCIBindByName($state, $key, $value[$i], $val['LENGTH']);
$i++;
}
http://www.php.net/manual/function.ocibindbyname.php