summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database
diff options
context:
space:
mode:
authorclawoo <alin.claudiu.radut@gmail.com>2014-10-22 18:10:55 +0200
committerclawoo <alin.claudiu.radut@gmail.com>2014-10-22 18:10:55 +0200
commit1db369f77a158d72fcb7fe44f84efcfe9ac2f0d7 (patch)
treee5040e01c91218aa838fcc0fd04d2c2ec4c9861c /user_guide_src/source/database
parentff8bff16c9857540f47a9ed093c6c4fb7348e1ad (diff)
Reword change log and add the resulting query in the manual.
Diffstat (limited to 'user_guide_src/source/database')
-rw-r--r--user_guide_src/source/database/queries.rst5
1 files changed, 4 insertions, 1 deletions
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
index b9152aac7..76ff1083f 100644
--- a/user_guide_src/source/database/queries.rst
+++ b/user_guide_src/source/database/queries.rst
@@ -132,11 +132,14 @@ 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::
+Binding also work with arrays, which will be transformed to IN sets::
$sql = "SELECT * FROM some_table WHERE id IN ? AND status = ? AND author = ?";
$this->db->query($sql, array(array(3, 6), 'live', 'Rick'));
+The resulting query will be::
+
+ SELECT * FROM some_table WHERE id IN (3,6) AND status = 'live' AND author = 'Rick'
The secondary benefit of using binds is that the values are
automatically escaped, producing safer queries. You don't have to