svn: /phpdoc/en/trunk/reference/oci8/functions/ oci-bind-by-name.xml
| From: | Christopher Jones | Date: | Sat, 14 Nov 2009 00:46:30 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/oci8/functions/ oci-bind-by-name.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-5383@lists.php.net to get a copy of this message | ||
sixd Sat, 14 Nov 2009 00:46:30 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=290729
Log:
Merge one more common user comment merged
Changed paths:
U phpdoc/en/trunk/reference/oci8/functions/oci-bind-by-name.xml
Modified: phpdoc/en/trunk/reference/oci8/functions/oci-bind-by-name.xml
===================================================================
--- phpdoc/en/trunk/reference/oci8/functions/oci-bind-by-name.xml 2009-11-14 00:37:06 UTC (rev
290728)
+++ phpdoc/en/trunk/reference/oci8/functions/oci-bind-by-name.xml 2009-11-14 00:46:30 UTC (rev
290729)
@@ -787,6 +787,35 @@
</note>
<note>
<para>
+ The PHP <parameter>variable</parameter> argument is a reference. Some
+ forms of loops do not work as expected:
+ </para>
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+foreach ($myarray as $key => $value) {
+ oci_bind_by_name($stid, $key, $value);
+}
+]]>
+ </programlisting>
+ </informalexample>
+ <para>
+ This binds each key to the location of $value, so all bound
+ variables end up pointing to the last loop iteration's
+ value. Instead use the following:
+ </para>
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+foreach ($myarray as $key => $value) {
+ oci_bind_by_name($stid, $key, $myarray[$key]);
+}
+]]>
+ </programlisting>
+ </informalexample>
+ </note>
+ <note>
+ <para>
In PHP versions before 5.0.0 you must
use <function>ocibindbyname</function>
instead. &oci.name.compat.note;