summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source
diff options
context:
space:
mode:
authorclawoo <alin.claudiu.radut@gmail.com>2014-10-21 09:41:02 +0200
committerclawoo <alin.claudiu.radut@gmail.com>2014-10-21 09:41:02 +0200
commitff8bff16c9857540f47a9ed093c6c4fb7348e1ad (patch)
treeed42dbc2896f5754bae38e20e313aa66f3748a8e /user_guide_src/source
parent4a4f5509832412aff3a6fb571d8be2454733e98b (diff)
Update the change log and the documentation with the array values binding feature.
Diffstat (limited to 'user_guide_src/source')
-rw-r--r--user_guide_src/source/changelog.rst1
-rw-r--r--user_guide_src/source/database/queries.rst6
2 files changed, 7 insertions, 0 deletions
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 0e4930289..adb8d88ce 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -173,6 +173,7 @@ Release Date: Not Released
- Added Interbase/Firebird database support via the *ibase* driver.
- Added ODBC support for ``create_database()``, ``drop_database()`` and ``drop_table()`` in :doc:`Database Forge <database/forge>`.
- Added **save_queries** configuration setting to *application/config/database.php* (defaults to ``TRUE``).
+ - Added support for escaping arrays sent as binding values to ``query()``
- :doc:`Query Builder <database/query_builder>` changes include:
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
index 90f49afb1..b9152aac7 100644
--- a/user_guide_src/source/database/queries.rst
+++ b/user_guide_src/source/database/queries.rst
@@ -132,6 +132,12 @@ put the queries together for you. Consider the following example::
The question marks in the query are automatically replaced with the
values in the array in the second parameter of the query function.
+Bindings also work with array values, useful for queries involving the IN operator::
+
+ $sql = "SELECT * FROM some_table WHERE id IN ? AND status = ? AND author = ?";
+ $this->db->query($sql, array(array(3, 6), 'live', 'Rick'));
+
+
The secondary benefit of using binds is that the values are
automatically escaped, producing safer queries. You don't have to
remember to manually escape data; the engine does it automatically for