summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/queries.rst
diff options
context:
space:
mode:
authorMike Funk <mfunk@xulonpress.com>2012-03-07 19:29:37 +0100
committerMike Funk <mfunk@xulonpress.com>2012-03-07 19:29:37 +0100
commit1909b5b1dd5e2d6847cbe4a87a0aadd52b506681 (patch)
tree8aaf0c86aa49dc0bacd55daeb2144d40c37ae8e0 /user_guide_src/source/database/queries.rst
parenta90b1f2f89a41b2fe061f5fdd3f84f08b961a887 (diff)
parent1d571971be8be78a92d31aad27dda4009770043f (diff)
merged from develop, fixed conflict in user guide.
Diffstat (limited to 'user_guide_src/source/database/queries.rst')
-rw-r--r--user_guide_src/source/database/queries.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/user_guide_src/source/database/queries.rst b/user_guide_src/source/database/queries.rst
index 971d5d61d..15a73614a 100644
--- a/user_guide_src/source/database/queries.rst
+++ b/user_guide_src/source/database/queries.rst
@@ -112,3 +112,20 @@ 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
you.
+
+***************
+Handling Errors
+***************
+
+$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
+example::
+
+ if ( ! $this->db->simple_query('SELECT `example_field` FROM `example_table`'))
+ {
+ $error = $this->db->error(); // Has keys 'code' and 'message'
+ }
+