note 62112 added to function.oci-bind-by-name
| From: | js at mcs dot be | Date: | Mon, 20 Feb 2006 12:48:22 +0000 |
| Subject: | note 62112 added to function.oci-bind-by-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104065@lists.php.net to get a copy of this message | ||
Be careful that the variable argument is a reference. So, the following code does not work:
foreach($some_array as $key => $value)
{
OCIBindByName($stmt, $key, $value);
}
I assume this is because the contents of $value changes, even though the reference remains the same,
so all bound variables end up pointing to the last loop iteration's value.
Instead use the following:
foreach($some_array as $key => $value)
{
OCIBindByName($stmt, $key, $some_array[$key]);
}
----
Server IP: 193.190.198.20
Probable Submitter: 81.246.24.98
----
Manual Page -- http://www.php.net/manual/en/function.oci-bind-by-name.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+62112
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62112&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62112&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62112&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62112&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62112&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62112&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62112&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+62112&report=yes
Search -- http://master.php.net/manage/user-notes.php