summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database/helpers.rst
diff options
context:
space:
mode:
authorBrennan Thompson <brenjt@gmail.com>2014-02-14 20:03:57 +0100
committerBrennan Thompson <brenjt@gmail.com>2014-02-14 20:03:57 +0100
commit6949f95f6e21980f36095490bf38fc8a172dbc0f (patch)
treeb3141f390acd0051396cda6a3da51c1f98384cca /user_guide_src/source/database/helpers.rst
parent68a02a01a086bbb1b8128ea2744439de84873d11 (diff)
parent81f036753272391360ba5b64e6dd93c4101a8733 (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Conflicts: system/helpers/form_helper.php
Diffstat (limited to 'user_guide_src/source/database/helpers.rst')
-rw-r--r--user_guide_src/source/database/helpers.rst27
1 files changed, 14 insertions, 13 deletions
diff --git a/user_guide_src/source/database/helpers.rst b/user_guide_src/source/database/helpers.rst
index e8a5ac801..77bf1b5d2 100644
--- a/user_guide_src/source/database/helpers.rst
+++ b/user_guide_src/source/database/helpers.rst
@@ -3,7 +3,7 @@ Query Helper Functions
######################
$this->db->insert_id()
-=======================
+======================
The insert ID number when performing database inserts.
@@ -12,7 +12,7 @@ The insert ID number when performing database inserts.
appropriate sequence to check for the insert id.
$this->db->affected_rows()
-===========================
+==========================
Displays the number of affected rows, when doing "write" type queries
(insert, update, etc.).
@@ -22,8 +22,8 @@ Displays the number of affected rows, when doing "write" type queries
affected rows. By default this hack is enabled but it can be turned off
in the database driver file.
-$this->db->count_all();
-========================
+$this->db->count_all()
+======================
Permits you to determine the number of rows in a particular table.
Submit the table name in the first parameter. Example::
@@ -47,8 +47,8 @@ Outputs the database version you are running::
echo $this->db->version();
-$this->db->last_query();
-=========================
+$this->db->last_query()
+=======================
Returns the last query that was run (the query string, not the result).
Example::
@@ -57,11 +57,12 @@ Example::
// Produces: SELECT * FROM sometable....
-The following two functions help simplify the process of writing
-database INSERTs and UPDATEs.
-$this->db->insert_string();
-============================
+.. note:: Disabling the **save_queries** setting in your database
+ configuration will render this function useless.
+
+$this->db->insert_string()
+==========================
This function simplifies the process of writing database inserts. It
returns a correctly formatted SQL insert string. Example::
@@ -77,8 +78,8 @@ array with the data to be inserted. The above example produces::
.. note:: Values are automatically escaped, producing safer queries.
-$this->db->update_string();
-============================
+$this->db->update_string()
+==========================
This function simplifies the process of writing database updates. It
returns a correctly formatted SQL update string. Example::
@@ -95,4 +96,4 @@ array with the data to be updated, and the third parameter is the
UPDATE table_name SET name = 'Rick', email = 'rick@example.com', url = 'example.com' WHERE author_id = 1 AND status = 'active'
-.. note:: Values are automatically escaped, producing safer queries.
+.. note:: Values are automatically escaped, producing safer queries. \ No newline at end of file