note 129247 added to function.oci-bind-by-name
| From: | dub357 at gmail dot com | Date: | Wed, 14 Feb 2024 16:08:23 +0000 |
| Subject: | note 129247 added to function.oci-bind-by-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221199@lists.php.net to get a copy of this message | ||
The note about the PHP var argument being a reference and some kinds of loops not working is very
important here. However, you can make a foreach loop work if you create a temporary variable, use
that in the bind and then unset it. For example:
<?php
foreach ($myarray as $key => $val) {
$value = $val;
oci_bind_by_name($stid, $key, $value);
unset($value);
}
?>
This binds each key to the location of $value, but when you unset it after binding, it can be set
and used again.
https://www.php.net/manual/en/function.unset.php
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.131 (proxied: 129.57.130.40)
----
Manual Page -- https://php.net/manual/en/function.oci-bind-by-name.php
Edit -- https://main.php.net/note/edit/129247
Del: integrated -- https://main.php.net/note/delete/129247/integrated
Del: useless -- https://main.php.net/note/delete/129247/useless
Del: bad code -- https://main.php.net/note/delete/129247/bad+code
Del: spam -- https://main.php.net/note/delete/129247/spam
Del: non-english -- https://main.php.net/note/delete/129247/non-english
Del: in docs -- https://main.php.net/note/delete/129247/in+docs
Del: other reasons-- https://main.php.net/note/delete/129247
Reject -- https://main.php.net/note/reject/129247
Search -- https://main.php.net/manage/user-notes.php