summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/queries.rst
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-11-25 10:17:30 +0100
committerAndrey Andreev <narf@devilix.net>2014-11-25 10:17:30 +0100
commit809a1b516d4760fe631f8d3ffa767b9f9310dacc (patch)
tree473d9c9ff073b351de87fa49b3369200289455ab /user_guide_src/source/database/queries.rst
parent8371eb1f77b0a325cb89ad437d572ef1b94f5cf4 (diff)
parent8b85526c6a9758ef92340ba0df6a32249a578b39 (diff)
Merge pull request #3369 from jim-parry/userguide/database
Userguide/database - part 1
Diffstat (limited to 'user_guide_src/source/database/queries.rst')
-rw-r--r--user_guide_src/source/database/queries.rst24
1 files changed, 15 insertions, 9 deletions
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
index 76ff1083f..43a0a30bf 100644
--- a/user_guide_src/source/database/queries.rst
+++ b/user_guide_src/source/database/queries.rst
@@ -2,10 +2,14 @@
Queries
#######
-$this->db->query();
-===================
+************
+Query Basics
+************
-To submit a query, use the following function::
+Regular Queries
+===============
+
+To submit a query, use the **query** function::
$this->db->query('YOUR QUERY HERE');
@@ -18,10 +22,11 @@ this::
$query = $this->db->query('YOUR QUERY HERE');
-$this->db->simple_query();
-==========================
+Simplified Queries
+==================
-This is a simplified version of the $this->db->query() method. It DOES
+The **simple_query** method is a simplified version of the
+$this->db->query() method. It DOES
NOT return a database result set, nor does it set the query timer, or
compile bind data, or store your query for debugging. It simply lets you
submit a query. Most users will rarely use this function.
@@ -116,7 +121,9 @@ this:
::
- $search = '20% raise'; $sql = "SELECT id FROM table WHERE column LIKE '%".$this->db->escape_like_str($search)."%'";
+ $search = '20% raise';
+ $sql = "SELECT id FROM table WHERE column LIKE '%" .
+ $this->db->escape_like_str($search)."%'";
**************
@@ -150,8 +157,7 @@ you.
Handling Errors
***************
-$this->db->error();
-===================
+**$this->db->error();**
If you need to get the last error that has occured, the error() method
will return an array containing its code and message. Here's a quick