diff options
author | Joel Kallman <jkallman@eclarian.com> | 2012-03-12 23:10:44 +0100 |
---|---|---|
committer | Joel Kallman <jkallman@eclarian.com> | 2012-03-12 23:10:44 +0100 |
commit | 7c4870c3741e165bc7bc06624c816e66db474ee2 (patch) | |
tree | a96962212cb012be32ab09545dcd5c4dbdac05e2 /user_guide_src/source/database/queries.rst | |
parent | 10aa8e660c6f439958b79fce5d85ce7e8eecf028 (diff) | |
parent | 6b535f51fcb94e0a645fda0d0356f4748076877e (diff) |
Merge branch 'develop' into feature/db_toString_support
Diffstat (limited to 'user_guide_src/source/database/queries.rst')
-rw-r--r-- | user_guide_src/source/database/queries.rst | 17 |
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' + } + |