Skip to content

Commit 021d76e

Browse files
committed
Clarify behavior of parameter binding for multiple executions
Based on a patch provided by BohwaZ. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@345969 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent 77b60aa commit 021d76e

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

reference/sqlite3/sqlite3stmt/bindparam.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
</varlistentry>
100100
</variablelist>
101101
</para>
102-
103102
</refsect1>
104103

105104
<refsect1 role="returnvalues">
@@ -110,6 +109,20 @@
110109
</para>
111110
</refsect1>
112111

112+
<refsect1 role="notes"><!-- {{{ -->
113+
&reftitle.notes;
114+
<caution>
115+
<para>
116+
<methodname>SQLite3Stmt::reset</methodname> must be called after the first call to
117+
<methodname>SQLite3Stmt::execute</methodname> if you want to see the bound value
118+
updated on following calls to <methodname>SQLite3Stmt::execute</methodname>.
119+
If <methodname>SQLite3Stmt::reset</methodname> is not called, the bound value will
120+
not change, even if the value assigned to the variable passed to
121+
<methodname>SQLite3Stmt::bindParam</methodname> has changed.
122+
</para>
123+
</caution>
124+
</refsect1><!-- }}} -->
125+
113126
<refsect1 role="examples">
114127
&reftitle.examples;
115128
<para>

reference/sqlite3/sqlite3stmt/bindvalue.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<para>
1919
Binds the value of a parameter to a statement variable.
2020
</para>
21+
<para>
22+
Once the statement has been executed, <methodname>SQLite3Stmt::reset</methodname>
23+
needs to be called to be able to change the value of bound parameters.
24+
</para>
2125
</refsect1>
2226

2327
<refsect1 role="parameters">

reference/sqlite3/sqlite3stmt/clear.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,17 @@
1414
<void />
1515
</methodsynopsis>
1616
<para>
17-
Clears all current bound parameters.
17+
Clears all current bound parameters (sets them to &null;).
1818
</para>
19+
<caution>
20+
<para>
21+
This method needs to be used with <methodname>SQLite3Stmt::reset</methodname>.
22+
If used alone, any call to
23+
<methodname>SQLite3Stmt::bindValue</methodname> or
24+
<methodname>SQLite3Stmt::bindParam</methodname> will be of no effect
25+
and all bound parameters will have the &null; value.
26+
</para>
27+
</caution>
1928
</refsect1>
2029

2130
<refsect1 role="parameters">

0 commit comments

Comments
 (0)