summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database
diff options
context:
space:
mode:
authorAhmad Anbar <aanbar@gmail.com>2015-04-06 18:59:53 +0200
committerAhmad Anbar <aanbar@gmail.com>2015-04-06 18:59:53 +0200
commit5e50c42ef27261bc7fcb279499ce76cfc2519aa6 (patch)
treed74d660534b72ddc0b6cda9147cecfb64a225346 /user_guide_src/source/database
parented520408514fff6486788e1543589418d24d885e (diff)
parent7726b75552f765af94038e47a4a4272ac08c646e (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'user_guide_src/source/database')
-rw-r--r--user_guide_src/source/database/configuration.rst6
-rw-r--r--user_guide_src/source/database/forge.rst4
-rw-r--r--user_guide_src/source/database/query_builder.rst19
-rw-r--r--user_guide_src/source/database/results.rst4
-rw-r--r--user_guide_src/source/database/utilities.rst6
5 files changed, 20 insertions, 19 deletions
diff --git a/user_guide_src/source/database/configuration.rst b/user_guide_src/source/database/configuration.rst
index 074725664..d21c79e44 100644
--- a/user_guide_src/source/database/configuration.rst
+++ b/user_guide_src/source/database/configuration.rst
@@ -27,7 +27,6 @@ prototype::
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
- 'autoinit' => TRUE,
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
@@ -70,7 +69,6 @@ These failovers can be specified by setting the failover for a connection like t
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
- 'autoinit' => TRUE,
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE
@@ -89,7 +87,6 @@ These failovers can be specified by setting the failover for a connection like t
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
- 'autoinit' => TRUE,
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE
@@ -120,7 +117,6 @@ example, to set up a "test" environment you would do this::
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
- 'autoinit' => TRUE,
'compress' => FALSE,
'encrypt' => FALSE,
'stricton' => FALSE,
@@ -181,8 +177,6 @@ Explanation of Values:
**swap_pre** A default table prefix that should be swapped with dbprefix. This is useful for distributed
applications where you might run manually written queries, and need the prefix to still be
customizable by the end user.
-**autoinit** Whether or not to automatically connect to the database when the library loads. If set to false,
- the connection will take place prior to executing the first query.
**schema** The database schema, defaults to 'public'. Used by PostgreSQL and ODBC drivers.
**encrypt** Whether or not to use an encrypted connection.
**compress** Whether or not to use client compression (MySQL only).
diff --git a/user_guide_src/source/database/forge.rst b/user_guide_src/source/database/forge.rst
index 89fac023e..a4edada5c 100644
--- a/user_guide_src/source/database/forge.rst
+++ b/user_guide_src/source/database/forge.rst
@@ -227,7 +227,7 @@ Execute a DROP TABLE statement and optionally add an IF EXISTS clause.
$this->dbforge->drop_table('table_name');
// Produces: DROP TABLE IF EXISTS table_name
- $this->dbforge->drop_table('table_name');
+ $this->dbforge->drop_table('table_name',TRUE);
Renaming a table
@@ -405,4 +405,4 @@ Class Reference
:returns: TRUE on success, FALSE on failure
:rtype: bool
- Renames a table. Usage: See `Renaming a table`_. \ No newline at end of file
+ Renames a table. Usage: See `Renaming a table`_.
diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst
index fa1e90353..0a6d98744 100644
--- a/user_guide_src/source/database/query_builder.rst
+++ b/user_guide_src/source/database/query_builder.rst
@@ -520,13 +520,19 @@ The second parameter lets you set a result offset.
Permits you to determine the number of rows in a particular Active
Record query. Queries will accept Query Builder restrictors such as
-where(), or_where(), like(), or_like(), etc. Example::
+``where()``, ``or_where()``, ``like()``, ``or_like()``, etc. Example::
echo $this->db->count_all_results('my_table'); // Produces an integer, like 25
$this->db->like('title', 'match');
$this->db->from('my_table');
echo $this->db->count_all_results(); // Produces an integer, like 17
+However, this method also resets any field values that you may have passed
+to ``select()``. If you need to keep them, you can pass ``FALSE`` as the
+second parameter::
+
+ echo $this->db->count_all_results('my_table', FALSE);
+
**$this->db->count_all()**
Permits you to determine the number of rows in a particular table.
@@ -1091,9 +1097,10 @@ Class Reference
Prepends a database prefix, if one exists in configuration.
- .. php:method:: count_all_results([$table = ''])
+ .. php:method:: count_all_results([$table = '', [$reset = TRUE]])
:param string $table: Table name
+ :param bool $reset: Whether to reset values for SELECTs
:returns: Number of rows in the query result
:rtype: int
@@ -1221,7 +1228,7 @@ Class Reference
:param string $key: The field to search
:param array $values: The values searched on
- :param boolean $escape: Whether to escape values and identifiers
+ :param boolean $escape: Whether to escape identifiers
:returns: DB_query_builder instance
:rtype: object
@@ -1232,7 +1239,7 @@ Class Reference
:param string $key: The field to search
:param array $values: The values searched on
- :param boolean $escape: Whether to escape values and identifiers
+ :param boolean $escape: Whether to escape identifiers
:returns: DB_query_builder instance
:rtype: object
@@ -1243,7 +1250,7 @@ Class Reference
:param string $key: Name of field to examine
:param array $values: Array of target values
- :param boolean $escape: Whether to escape values and identifiers
+ :param boolean $escape: Whether to escape identifiers
:returns: DB_query_builder instance
:rtype: object
@@ -1254,7 +1261,7 @@ Class Reference
:param string $key: Name of field to examine
:param array $values: Array of target values
- :param boolean $escape: Whether to escape values and identifiers
+ :param boolean $escape: Whether to escape identifiers
:returns: DB_query_builder instance
:rtype: object
diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst
index a22c2e8c3..ac44566d3 100644
--- a/user_guide_src/source/database/results.rst
+++ b/user_guide_src/source/database/results.rst
@@ -102,7 +102,7 @@ You can also add a second String parameter, which is the name of a class
to instantiate the row with::
$query = $this->db->query("SELECT * FROM users LIMIT 1;");
- $query->row(0, 'User');
+ $row = $query->row(0, 'User');
echo $row->name; // access attributes
echo $row->reverse_name(); // or methods defined on the 'User' class
@@ -431,4 +431,4 @@ Class Reference
:rtype: array
Returns an array containing the field names in the
- result set. \ No newline at end of file
+ result set.
diff --git a/user_guide_src/source/database/utilities.rst b/user_guide_src/source/database/utilities.rst
index bafa08ed5..cc4aeb018 100644
--- a/user_guide_src/source/database/utilities.rst
+++ b/user_guide_src/source/database/utilities.rst
@@ -295,7 +295,7 @@ Class Reference
Repairs a database table.
- .. php:method:: csv_from_results($query[, $delim = ','[, $newline = "\n"[, $enclosure = '"']]])
+ .. php:method:: csv_from_result($query[, $delim = ','[, $newline = "\n"[, $enclosure = '"']]])
:param object $query: A database result object
:param string $delim: The CSV field delimiter to use
@@ -306,11 +306,11 @@ Class Reference
Translates a database result object into a CSV document.
- .. php:method:: xml_from_results($query[, $params = array()])
+ .. php:method:: xml_from_result($query[, $params = array()])
:param object $query: A database result object
:param array $params: An associative array of preferences
:returns: The generated XML document as a string
:rtype: string
- Translates a database result object into an XML document. \ No newline at end of file
+ Translates a database result object into an XML document.