summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/queries.rst
diff options
context:
space:
mode:
authorGreg Aker <greg@gregaker.net>2011-10-07 05:22:48 +0200
committerGreg Aker <greg@gregaker.net>2011-10-07 05:22:48 +0200
commit02db0666a8b4da6a58db0e2f6755143ce1b21971 (patch)
tree5f001704bb6a119693e40675a4951db6d462988e /user_guide_src/source/database/queries.rst
parent4c5dfdfb57fdbda43c79333fa5b3442f1f6c0629 (diff)
parentf24f404a34081241c1398f568b506e2c9d9bec5b (diff)
Merge branch 'user_guide' of https://github.com/jwensley2/CodeIgniter into jwensley2-user_guide
Conflicts: user_guide_src/source/database/configuration.rst
Diffstat (limited to 'user_guide_src/source/database/queries.rst')
-rw-r--r--user_guide_src/source/database/queries.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
index cfc42c4c3..971d5d61d 100644
--- a/user_guide_src/source/database/queries.rst
+++ b/user_guide_src/source/database/queries.rst
@@ -41,7 +41,8 @@ the following::
If for any reason you would like to change the prefix programatically
without needing to create a new connection, you can use this method::
- $this->db->set_dbprefix('newprefix'); $this->db->dbprefix('tablename'); // outputs newprefix_tablename
+ $this->db->set_dbprefix('newprefix');
+ $this->db->dbprefix('tablename'); // outputs newprefix_tablename
**********************
@@ -101,7 +102,8 @@ Query Bindings
Bindings enable you to simplify your query syntax by letting the system
put the queries together for you. Consider the following example::
- $sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?"; $this->db->query($sql, array(3, 'live', 'Rick'));
+ $sql = "SELECT * FROM some_table WHERE id = ? AND status = ? AND author = ?";
+ $this->db->query($sql, array(3, 'live', 'Rick'));
The question marks in the query are automatically replaced with the
values in the array in the second parameter of the query function.