Skip to content

Commit 1db369f

Browse files
committed
Reword change log and add the resulting query in the manual.
1 parent ff8bff1 commit 1db369f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

user_guide_src/source/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Release Date: Not Released
173173
- Added Interbase/Firebird database support via the *ibase* driver.
174174
- Added ODBC support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`.
175175
- Added **save_queries** configuration setting to *application/config/database.php* (defaults to ``TRUE``).
176-
- Added support for escaping arrays sent as binding values to ``query()``
176+
- Added support to binding arrays as ``IN()`` sets in ``query()``.
177177

178178
- :doc:`Query Builder <database/query_builder>` changes include:
179179

user_guide_src/source/database/queries.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,14 @@ put the queries together for you. Consider the following example::
132132
The question marks in the query are automatically replaced with the
133133
values in the array in the second parameter of the query function.
134134

135-
Bindings also work with array values, useful for queries involving the IN operator::
135+
Binding also work with arrays, which will be transformed to IN sets::
136136

137137
$sql = "SELECT * FROM some_table WHERE id IN ? AND status = ? AND author = ?";
138138
$this->db->query($sql, array(array(3, 6), 'live', 'Rick'));
139139

140+
The resulting query will be::
141+
142+
SELECT * FROM some_table WHERE id IN (3,6) AND status = 'live' AND author = 'Rick'
140143

141144
The secondary benefit of using binds is that the values are
142145
automatically escaped, producing safer queries. You don't have to

0 commit comments

Comments
 (0)