summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/queries.rst
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-10-05 21:45:41 +0200
committerAndrey Andreev <narf@bofh.bg>2012-10-05 21:45:41 +0200
commit5b5021812ea6dc859312e00b6b0f078eea54c88d (patch)
tree0a8840ee0429cc405cb597438a73d03bca970c1a /user_guide_src/source/database/queries.rst
parent49d08053257b55db511eaca08b8ab5d12149f3b6 (diff)
parentdbad54e09a39a77c7404dee9ca1a6b34299469d0 (diff)
Merge upstream branch
Diffstat (limited to 'user_guide_src/source/database/queries.rst')
-rw-r--r--user_guide_src/source/database/queries.rst30
1 files changed, 25 insertions, 5 deletions
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
index d23efecb3..11dd78392 100644
--- a/user_guide_src/source/database/queries.rst
+++ b/user_guide_src/source/database/queries.rst
@@ -21,11 +21,31 @@ this::
$this->db->simple_query();
===========================
-This is a simplified version of the $this->db->query() function. It ONLY
-returns TRUE/FALSE on success or failure. 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.
+This 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.
+
+It returns whatever the database drivers' "execute" function returns.
+That typically is TRUE/FALSE on success or failure for write type queries
+such as INSERT, DELETE or UPDATE statements (which is what it really
+should be used for) and a resource/object on success for queries with
+fetchable results.
+
+::
+
+ if ($this->db->simple_query('YOUR QUERY'))
+ {
+ echo "Success!";
+ }
+ else
+ {
+ echo "Query failed!";
+ }
+
+.. note:: PostgreSQL's pg_exec() function always returns a resource on
+ success, even for write type queries. So take that in mind if
+ you're looking for a boolean value.
***************************************
Working with Database prefixes manually