summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/database
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-02-02 12:41:01 +0100
committerAndrey Andreev <narf@devilix.net>2015-02-02 12:41:01 +0100
commitcd3d9dbcbc99fa956b7400d328f202e1bcab4677 (patch)
treeca1e12b6751f31de8f49055118318643f7d647c7 /user_guide_src/source/database
parent7fd0c2d22ccbeb824419477ae8b506b84002ea13 (diff)
[ci skip] Fix #3515
Diffstat (limited to 'user_guide_src/source/database')
-rw-r--r--user_guide_src/source/database/db_driver_reference.rst86
-rw-r--r--user_guide_src/source/database/forge.rst22
-rw-r--r--user_guide_src/source/database/query_builder.rst108
-rw-r--r--user_guide_src/source/database/results.rst42
-rw-r--r--user_guide_src/source/database/utilities.rst18
5 files changed, 138 insertions, 138 deletions
diff --git a/user_guide_src/source/database/db_driver_reference.rst b/user_guide_src/source/database/db_driver_reference.rst
index 7bee555c8..005e6b3dc 100644
--- a/user_guide_src/source/database/db_driver_reference.rst
+++ b/user_guide_src/source/database/db_driver_reference.rst
@@ -13,9 +13,9 @@ This article is intended to be a reference for them.
some of them may fail (and return FALSE) if the underlying
driver does not support them.
-.. class:: CI_DB_driver
+.. php:class:: CI_DB_driver
- .. method:: initialize()
+ .. php:method:: initialize()
:returns: TRUE on success, FALSE on failure
:rtype: bool
@@ -23,7 +23,7 @@ This article is intended to be a reference for them.
Initialize database settings, establish a connection to
the database.
- .. method:: db_connect($persistent = TRUE)
+ .. php:method:: db_connect($persistent = TRUE)
:param bool $persistent: Whether to establish a persistent connection or a regular one
:returns: Database connection resource/object or FALSE on failure
@@ -35,7 +35,7 @@ This article is intended to be a reference for them.
driver in use. For example, a ``mysqli`` instance
will be returned with the 'mysqli' driver.
- .. method:: db_pconnect()
+ .. php:method:: db_pconnect()
:returns: Database connection resource/object or FALSE on failure
:rtype: mixed
@@ -44,7 +44,7 @@ This article is intended to be a reference for them.
.. note:: This method is just an alias for ``db_connect(TRUE)``.
- .. method:: reconnect()
+ .. php:method:: reconnect()
:returns: TRUE on success, FALSE on failure
:rtype: bool
@@ -53,7 +53,7 @@ This article is intended to be a reference for them.
have been sent for a length of time exceeding the
server's idle timeout.
- .. method:: db_select([$database = ''])
+ .. php:method:: db_select([$database = ''])
:param string $database: Database name
:returns: TRUE on success, FALSE on failure
@@ -61,7 +61,7 @@ This article is intended to be a reference for them.
Select / switch the current database.
- .. method:: db_set_charset($charset)
+ .. php:method:: db_set_charset($charset)
:param string $charset: Character set name
:returns: TRUE on success, FALSE on failure
@@ -69,21 +69,21 @@ This article is intended to be a reference for them.
Set client character set.
- .. method:: platform()
+ .. php:method:: platform()
:returns: Platform name
:rtype: string
The name of the platform in use (mysql, mssql, etc...).
- .. method:: version()
+ .. php:method:: version()
:returns: The version of the database being used
:rtype: string
Database version number.
- .. method:: query($sql[, $binds = FALSE[, $return_object = NULL]]])
+ .. php:method:: query($sql[, $binds = FALSE[, $return_object = NULL]]])
:param string $sql: The SQL statement to execute
:param array $binds: An array of binding data
@@ -106,7 +106,7 @@ This article is intended to be a reference for them.
page will be displayed instead of returning FALSE
on failures and script execution will stop.
- .. method:: simple_query($sql)
+ .. php:method:: simple_query($sql)
:param string $sql: The SQL statement to execute
:returns: Whatever the underlying driver's "query" function returns
@@ -116,7 +116,7 @@ This article is intended to be a reference for them.
for use when you don't need to get a result object or to
just send a query to the database and not care for the result.
- .. method:: trans_strict([$mode = TRUE])
+ .. php:method:: trans_strict([$mode = TRUE])
:param bool $mode: Strict mode flag
:rtype: void
@@ -131,26 +131,26 @@ This article is intended to be a reference for them.
autonomously, meaning a failure of one group will not
affect any others.
- .. method:: trans_off()
+ .. php:method:: trans_off()
:rtype: void
Disables transactions at run-time.
- .. method:: trans_start([$test_mode = FALSE])
+ .. php:method:: trans_start([$test_mode = FALSE])
:param bool $test_mode: Test mode flag
:rtype: void
Start a transaction.
- .. method:: trans_complete()
+ .. php:method:: trans_complete()
:rtype: void
Complete Transaction.
- .. method:: trans_status()
+ .. php:method:: trans_status()
:returns: TRUE if the transaction succeeded, FALSE if it failed
:rtype: bool
@@ -158,7 +158,7 @@ This article is intended to be a reference for them.
Lets you retrieve the transaction status flag to
determine if it has failed.
- .. method:: compile_binds($sql, $binds)
+ .. php:method:: compile_binds($sql, $binds)
:param string $sql: The SQL statement
:param array $binds: An array of binding data
@@ -167,7 +167,7 @@ This article is intended to be a reference for them.
Compiles an SQL query with the bind values passed for it.
- .. method:: is_write_type($sql)
+ .. php:method:: is_write_type($sql)
:param string $sql: The SQL statement
:returns: TRUE if the SQL statement is of "write type", FALSE if not
@@ -176,7 +176,7 @@ This article is intended to be a reference for them.
Determines if a query is of a "write" type (such as
INSERT, UPDATE, DELETE) or "read" type (i.e. SELECT).
- .. method:: elapsed_time([$decimals = 6])
+ .. php:method:: elapsed_time([$decimals = 6])
:param int $decimals: The number of decimal places
:returns: The aggregate query elapsed time, in microseconds
@@ -184,7 +184,7 @@ This article is intended to be a reference for them.
Calculate the aggregate query elapsed time.
- .. method:: total_queries()
+ .. php:method:: total_queries()
:returns: The total number of queries executed
:rtype: int
@@ -192,14 +192,14 @@ This article is intended to be a reference for them.
Returns the total number of queries that have been
executed so far.
- .. method:: last_query()
+ .. php:method:: last_query()
:returns: The last query executed
:rtype: string
Returns the last query that was executed.
- .. method:: escape($str)
+ .. php:method:: escape($str)
:param mixed $str: The value to escape, or an array of multiple ones
:returns: The escaped value(s)
@@ -208,7 +208,7 @@ This article is intended to be a reference for them.
Escapes input data based on type, including boolean and
NULLs.
- .. method:: escape_str($str[, $like = FALSE])
+ .. php:method:: escape_str($str[, $like = FALSE])
:param mixed $str: A string value or array of multiple ones
:param bool $like: Whether or not the string will be used in a LIKE condition
@@ -220,7 +220,7 @@ This article is intended to be a reference for them.
.. warning:: The returned strings do NOT include quotes
around them.
- .. method:: escape_like_str($str)
+ .. php:method:: escape_like_str($str)
:param mixed $str: A string value or array of multiple ones
:returns: The escaped string(s)
@@ -232,7 +232,7 @@ This article is intended to be a reference for them.
and ``_`` wildcard characters, so that they don't cause
false-positives in LIKE conditions.
- .. method:: primary($table)
+ .. php:method:: primary($table)
:param string $table: Table name
:returns: The primary key name, FALSE if none
@@ -244,7 +244,7 @@ This article is intended to be a reference for them.
key detection, the first column name may be assumed
as the primary key.
- .. method:: count_all([$table = ''])
+ .. php:method:: count_all([$table = ''])
:param string $table: Table name
:returns: Row count for the specified table
@@ -253,7 +253,7 @@ This article is intended to be a reference for them.
Returns the total number of rows in a table, or 0 if no
table was provided.
- .. method:: list_tables([$constrain_by_prefix = FALSE])
+ .. php:method:: list_tables([$constrain_by_prefix = FALSE])
:param bool $constrain_by_prefix: TRUE to match table names by the configured dbprefix
:returns: Array of table names or FALSE on failure
@@ -261,7 +261,7 @@ This article is intended to be a reference for them.
Gets a list of the tables in the current database.
- .. method:: table_exists($table_name)
+ .. php:method:: table_exists($table_name)
:param string $table_name: The table name
:returns: TRUE if that table exists, FALSE if not
@@ -269,7 +269,7 @@ This article is intended to be a reference for them.
Determine if a particular table exists.
- .. method:: list_fields($table)
+ .. php:method:: list_fields($table)
:param string $table: The table name
:returns: Array of field names or FALSE on failure
@@ -277,7 +277,7 @@ This article is intended to be a reference for them.
Gets a list of the field names in a table.
- .. method:: field_exists($field_name, $table_name)
+ .. php:method:: field_exists($field_name, $table_name)
:param string $table_name: The table name
:param string $field_name: The field name
@@ -286,7 +286,7 @@ This article is intended to be a reference for them.
Determine if a particular field exists.
- .. method:: field_data($table)
+ .. php:method:: field_data($table)
:param string $table: The table name
:returns: Array of field data items or FALSE on failure
@@ -294,7 +294,7 @@ This article is intended to be a reference for them.
Gets a list containing field data about a table.
- .. method:: escape_identifiers($item)
+ .. php:method:: escape_identifiers($item)
:param mixed $item: The item or array of items to escape
:returns: The input item(s), escaped
@@ -302,7 +302,7 @@ This article is intended to be a reference for them.
Escape SQL identifiers, such as column, table and names.
- .. method:: insert_string($table, $data)
+ .. php:method:: insert_string($table, $data)
:param string $table: The target table
:param array $data: An associative array of key/value pairs
@@ -311,7 +311,7 @@ This article is intended to be a reference for them.
Generate an INSERT statement string.
- .. method:: update_string($table, $data, $where)
+ .. php:method:: update_string($table, $data, $where)
:param string $table: The target table
:param array $data: An associative array of key/value pairs
@@ -321,7 +321,7 @@ This article is intended to be a reference for them.
Generate an UPDATE statement string.
- .. method:: call_function($function)
+ .. php:method:: call_function($function)
:param string $function: Function name
:returns: The function result
@@ -330,28 +330,28 @@ This article is intended to be a reference for them.
Runs a native PHP function , using a platform agnostic
wrapper.
- .. method:: cache_set_path([$path = ''])
+ .. php:method:: cache_set_path([$path = ''])
:param string $path: Path to the cache directory
:rtype: void
Sets the directory path to use for caching storage.
- .. method:: cache_on()
+ .. php:method:: cache_on()
:returns: TRUE if caching is on, FALSE if not
:rtype: bool
Enable database results caching.
- .. method:: cache_off()
+ .. php:method:: cache_off()
:returns: TRUE if caching is on, FALSE if not
:rtype: bool
Disable database results caching.
- .. method:: cache_delete([$segment_one = ''[, $segment_two = '']])
+ .. php:method:: cache_delete([$segment_one = ''[, $segment_two = '']])
:param string $segment_one: First URI segment
:param string $segment_two: Second URI segment
@@ -360,20 +360,20 @@ This article is intended to be a reference for them.
Delete the cache files associated with a particular URI.
- .. method:: cache_delete_all()
+ .. php:method:: cache_delete_all()
:returns: TRUE on success, FALSE on failure
:rtype: bool
Delete all cache files.
- .. method:: close()
+ .. php:method:: close()
:rtype: void
Close the DB Connection.
- .. method:: display_error([$error = ''[, $swap = ''[, $native = FALSE]]])
+ .. php:method:: display_error([$error = ''[, $swap = ''[, $native = FALSE]]])
:param string $error: The error message
:param string $swap: Any "swap" values
@@ -388,7 +388,7 @@ This article is intended to be a reference for them.
The message is displayed using the
*application/views/errors/error_db.php* template.
- .. method:: protect_identifiers($item[, $prefix_single = FALSE[, $protect_identifiers = NULL[, $field_exists = TRUE]]])
+ .. php:method:: protect_identifiers($item[, $prefix_single = FALSE[, $protect_identifiers = NULL[, $field_exists = TRUE]]])
:param string $item: The item to work with
:param bool $prefix_single: Whether to apply the dbprefix even if the input item is a single identifier
diff --git a/user_guide_src/source/database/forge.rst b/user_guide_src/source/database/forge.rst
index 59a6591b7..89fac023e 100644
--- a/user_guide_src/source/database/forge.rst
+++ b/user_guide_src/source/database/forge.rst
@@ -316,9 +316,9 @@ change the name you can add a "name" key into the field defining array.
Class Reference
***************
-.. class:: CI_DB_forge
+.. php:class:: CI_DB_forge
- .. method:: add_column($table[, $field = array()[, $_after = NULL]])
+ .. php:method:: add_column($table[, $field = array()[, $_after = NULL]])
:param string $table: Table name to add the column to
:param array $field: Column definition(s)
@@ -328,7 +328,7 @@ Class Reference
Adds a column to a table. Usage: See `Adding a Column to a Table`_.
- .. method:: add_field($field)
+ .. php:method:: add_field($field)
:param array $field: Field definition to add
:returns: CI_DB_forge instance (method chaining)
@@ -336,7 +336,7 @@ Class Reference
Adds a field to the set that will be used to create a table. Usage: See `Adding fields`_.
- .. method:: add_key($key[, $primary = FALSE])
+ .. php:method:: add_key($key[, $primary = FALSE])
:param array $key: Name of a key field
:param bool $primary: Set to TRUE if it should be a primary key or a regular one
@@ -345,7 +345,7 @@ Class Reference
Adds a key to the set that will be used to create a table. Usage: See `Adding Keys`_.
- .. method:: create_database($db_name)
+ .. php:method:: create_database($db_name)
:param string $db_name: Name of the database to create
:returns: TRUE on success, FALSE on failure
@@ -353,7 +353,7 @@ Class Reference
Creates a new database. Usage: See `Creating and Dropping Databases`_.
- .. method:: create_table($table[, $if_not_exists = FALSE[, array $attributes = array()]])
+ .. php:method:: create_table($table[, $if_not_exists = FALSE[, array $attributes = array()]])
:param string $table: Name of the table to create
:param string $if_not_exists: Set to TRUE to add an 'IF NOT EXISTS' clause
@@ -363,7 +363,7 @@ Class Reference
Creates a new table. Usage: See `Creating a table`_.
- .. method:: drop_column($table, $column_name)
+ .. php:method:: drop_column($table, $column_name)
:param string $table: Table name
:param array $column_name: The column name to drop
@@ -372,7 +372,7 @@ Class Reference
Drops a column from a table. Usage: See `Dropping a Column From a Table`_.
- .. method:: drop_database($db_name)
+ .. php:method:: drop_database($db_name)
:param string $db_name: Name of the database to drop
:returns: TRUE on success, FALSE on failure
@@ -380,7 +380,7 @@ Class Reference
Drops a database. Usage: See `Creating and Dropping Databases`_.
- .. method:: drop_table($table_name[, $if_exists = FALSE])
+ .. php:method:: drop_table($table_name[, $if_exists = FALSE])
:param string $table: Name of the table to drop
:param string $if_exists: Set to TRUE to add an 'IF EXISTS' clause
@@ -389,7 +389,7 @@ Class Reference
Drops a table. Usage: See `Dropping a table`_.
- .. method:: modify_column($table, $field)
+ .. php:method:: modify_column($table, $field)
:param string $table: Table name
:param array $field: Column definition(s)
@@ -398,7 +398,7 @@ Class Reference
Modifies a table column. Usage: See `Modifying a Column in a Table`_.
- .. method:: rename_table($table_name, $new_table_name)
+ .. php:method:: rename_table($table_name, $new_table_name)
:param string $table: Current of the table
:param string $new_table_name: New name of the table
diff --git a/user_guide_src/source/database/query_builder.rst b/user_guide_src/source/database/query_builder.rst
index b06396e96..fa1e90353 100644
--- a/user_guide_src/source/database/query_builder.rst
+++ b/user_guide_src/source/database/query_builder.rst
@@ -1044,9 +1044,9 @@ run the query::
Class Reference
***************
-.. class:: CI_DB_query_builder
+.. php:class:: CI_DB_query_builder
- .. method:: reset_query()
+ .. php:method:: reset_query()
:returns: CI_DB_query_builder instance (method chaining)
:rtype: CI_DB_query_builder
@@ -1054,28 +1054,28 @@ Class Reference
Resets the current Query Builder state. Useful when you want
to build a query that can be cancelled under certain conditions.
- .. method:: start_cache()
+ .. php:method:: start_cache()
:returns: CI_DB_query_builder instance (method chaining)
:rtype: CI_DB_query_builder
Starts the Query Builder cache.
- .. method:: stop_cache()
+ .. php:method:: stop_cache()
:returns: CI_DB_query_builder instance (method chaining)
:rtype: CI_DB_query_builder
Stops the Query Builder cache.
- .. method:: flush_cache()
+ .. php:method:: flush_cache()
:returns: CI_DB_query_builder instance (method chaining)
:rtype: CI_DB_query_builder
Empties the Query Builder cache.
- .. method:: set_dbprefix([$prefix = ''])
+ .. php:method:: set_dbprefix([$prefix = ''])
:param string $prefix: The new prefix to use
:returns: The DB prefix in use
@@ -1083,7 +1083,7 @@ Class Reference
Sets the database prefix, without having to reconnect.
- .. method:: dbprefix([$table = ''])
+ .. php:method:: dbprefix([$table = ''])
:param string $table: The table name to prefix
:returns: The prefixed table name
@@ -1091,7 +1091,7 @@ Class Reference
Prepends a database prefix, if one exists in configuration.
- .. method:: count_all_results([$table = ''])
+ .. php:method:: count_all_results([$table = ''])
:param string $table: Table name
:returns: Number of rows in the query result
@@ -1100,7 +1100,7 @@ Class Reference
Generates a platform-specific query string that counts
all records returned by an Query Builder query.
- .. method:: get([$table = ''[, $limit = NULL[, $offset = NULL]]])
+ .. php:method:: get([$table = ''[, $limit = NULL[, $offset = NULL]]])
:param string $table: The table to query
:param int $limit: The LIMIT clause
@@ -1111,7 +1111,7 @@ Class Reference
Compiles and runs SELECT statement based on the already
called Query Builder methods.
- .. method:: get_where([$table = ''[, $where = NULL[, $limit = NULL[, $offset = NULL]]]])
+ .. php:method:: get_where([$table = ''[, $where = NULL[, $limit = NULL[, $offset = NULL]]]])
:param mixed $table: The table(s) to fetch data from; string or array
:param string $where: The WHERE clause
@@ -1122,7 +1122,7 @@ Class Reference
Same as ``get()``, but also allows the WHERE to be added directly.
- .. method:: select([$select = '*'[, $escape = NULL]])
+ .. php:method:: select([$select = '*'[, $escape = NULL]])
:param string $select: The SELECT portion of a query
:param bool $escape: Whether to escape values and identifiers
@@ -1131,7 +1131,7 @@ Class Reference
Adds a SELECT clause to a query.
- .. method:: select_avg([$select = ''[, $alias = '']])
+ .. php:method:: select_avg([$select = ''[, $alias = '']])
:param string $select: Field to compute the average of
:param string $alias: Alias for the resulting value name
@@ -1140,7 +1140,7 @@ Class Reference
Adds a SELECT AVG(field) clause to a query.
- .. method:: select_max([$select = ''[, $alias = '']])
+ .. php:method:: select_max([$select = ''[, $alias = '']])
:param string $select: Field to compute the maximum of
:param string $alias: Alias for the resulting value name
@@ -1149,7 +1149,7 @@ Class Reference
Adds a SELECT MAX(field) clause to a query.
- .. method:: select_min([$select = ''[, $alias = '']])
+ .. php:method:: select_min([$select = ''[, $alias = '']])
:param string $select: Field to compute the minimum of
:param string $alias: Alias for the resulting value name
@@ -1158,7 +1158,7 @@ Class Reference
Adds a SELECT MIN(field) clause to a query.
- .. method:: select_sum([$select = ''[, $alias = '']])
+ .. php:method:: select_sum([$select = ''[, $alias = '']])
:param string $select: Field to compute the sum of
:param string $alias: Alias for the resulting value name
@@ -1167,7 +1167,7 @@ Class Reference
Adds a SELECT SUM(field) clause to a query.
- .. method:: distinct([$val = TRUE])
+ .. php:method:: distinct([$val = TRUE])
:param bool $val: Desired value of the "distinct" flag
:returns: CI_DB_query_builder instance (method chaining)
@@ -1176,7 +1176,7 @@ Class Reference
Sets a flag which tells the query builder to add
a DISTINCT clause to the SELECT portion of the query.
- .. method:: from($from)
+ .. php:method:: from($from)
:param mixed $from: Table name(s); string or array
:returns: CI_DB_query_builder instance (method chaining)
@@ -1184,7 +1184,7 @@ Class Reference
Specifies the FROM clause of a query.
- .. method:: join($table, $cond[, $type = ''[, $escape = NULL]])
+ .. php:method:: join($table, $cond[, $type = ''[, $escape = NULL]])
:param string $table: Table name to join
:param string $cond: The JOIN ON condition
@@ -1195,7 +1195,7 @@ Class Reference
Adds a JOIN clause to a query.
- .. method:: where($key[, $value = NULL[, $escape = NULL]])
+ .. php:method:: where($key[, $value = NULL[, $escape = NULL]])
:param mixed $key: Name of field to compare, or associative array
:param mixed $value: If a single key, compared to this value
@@ -1206,7 +1206,7 @@ Class Reference
Generates the WHERE portion of the query.
Separates multiple calls with 'AND'.
- .. method:: or_where($key[, $value = NULL[, $escape = NULL]])
+ .. php:method:: or_where($key[, $value = NULL[, $escape = NULL]])
:param mixed $key: Name of field to compare, or associative array
:param mixed $value: If a single key, compared to this value
@@ -1217,7 +1217,7 @@ Class Reference
Generates the WHERE portion of the query.
Separates multiple calls with 'OR'.
- .. method:: or_where_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
+ .. php:method:: or_where_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
:param string $key: The field to search
:param array $values: The values searched on
@@ -1228,7 +1228,7 @@ Class Reference
Generates a WHERE field IN('item', 'item') SQL query,
joined with 'OR' if appropriate.
- .. method:: or_where_not_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
+ .. php:method:: or_where_not_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
:param string $key: The field to search
:param array $values: The values searched on
@@ -1239,7 +1239,7 @@ Class Reference
Generates a WHERE field NOT IN('item', 'item') SQL query,
joined with 'OR' if appropriate.
- .. method:: where_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
+ .. php:method:: where_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
:param string $key: Name of field to examine
:param array $values: Array of target values
@@ -1250,7 +1250,7 @@ Class Reference
Generates a WHERE field IN('item', 'item') SQL query,
joined with 'AND' if appropriate.
- .. method:: where_not_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
+ .. php:method:: where_not_in([$key = NULL[, $values = NULL[, $escape = NULL]]])
:param string $key: Name of field to examine
:param array $values: Array of target values
@@ -1261,42 +1261,42 @@ Class Reference
Generates a WHERE field NOT IN('item', 'item') SQL query,
joined with 'AND' if appropriate.
- .. method:: group_start()
+ .. php:method:: group_start()
:returns: CI_DB_query_builder instance (method chaining)
:rtype: CI_DB_query_builder
Starts a group expression, using ANDs for the conditions inside it.
- .. method:: or_group_start()
+ .. php:method:: or_group_start()
:returns: CI_DB_query_builder instance (method chaining)
:rtype: CI_DB_query_builder
Starts a group expression, using ORs for the conditions inside it.
- .. method:: not_group_start()
+ .. php:method:: not_group_start()
:returns: CI_DB_query_builder instance (method chaining)
:rtype: CI_DB_query_builder
Starts a group expression, using AND NOTs for the conditions inside it.
- .. method:: or_not_group_start()
+ .. php:method:: or_not_group_start()
:returns: CI_DB_query_builder instance (method chaining)
:rtype: CI_DB_query_builder
Starts a group expression, using OR NOTs for the conditions inside it.
- .. method:: group_end()
+ .. php:method:: group_end()
:returns: DB_query_builder instance
:rtype: object
Ends a group expression.
- .. method:: like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
+ .. php:method:: like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
:param string $field: Field name
:param string $match: Text portion to match
@@ -1307,7 +1307,7 @@ Class Reference
Adds a LIKE clause to a query, separating multiple calls with AND.
- .. method:: or_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
+ .. php:method:: or_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
:param string $field: Field name
:param string $match: Text portion to match
@@ -1318,7 +1318,7 @@ Class Reference
Adds a LIKE clause to a query, separating multiple class with OR.
- .. method:: not_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
+ .. php:method:: not_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
:param string $field: Field name
:param string $match: Text portion to match
@@ -1329,7 +1329,7 @@ Class Reference
Adds a NOT LIKE clause to a query, separating multiple calls with AND.
- .. method:: or_not_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
+ .. php:method:: or_not_like($field[, $match = ''[, $side = 'both'[, $escape = NULL]]])
:param string $field: Field name
:param string $match: Text portion to match
@@ -1340,7 +1340,7 @@ Class Reference
Adds a NOT LIKE clause to a query, separating multiple calls with OR.
- .. method:: having($key[, $value = NULL[, $escape = NULL]])
+ .. php:method:: having($key[, $value = NULL[, $escape = NULL]])
:param mixed $key: Identifier (string) or associative array of field/value pairs
:param string $value: Value sought if $key is an identifier
@@ -1350,7 +1350,7 @@ Class Reference
Adds a HAVING clause to a query, separating multiple calls with AND.
- .. method:: or_having($key[, $value = NULL[, $escape = NULL]])
+ .. php:method:: or_having($key[, $value = NULL[, $escape = NULL]])
:param mixed $key: Identifier (string) or associative array of field/value pairs
:param string $value: Value sought if $key is an identifier
@@ -1360,7 +1360,7 @@ Class Reference
Adds a HAVING clause to a query, separating multiple calls with OR.
- .. method:: group_by($by[, $escape = NULL])
+ .. php:method:: group_by($by[, $escape = NULL])
:param mixed $by: Field(s) to group by; string or array
:returns: CI_DB_query_builder instance (method chaining)
@@ -1368,7 +1368,7 @@ Class Reference
Adds a GROUP BY clause to a query.
- .. method:: order_by($orderby[, $direction = ''[, $escape = NULL]])
+ .. php:method:: order_by($orderby[, $direction = ''[, $escape = NULL]])
:param string $orderby: Field to order by
:param string $direction: The order requested - ASC, DESC or random
@@ -1378,7 +1378,7 @@ Class Reference
Adds an ORDER BY clause to a query.
- .. method:: limit($value[, $offset = 0])
+ .. php:method:: limit($value[, $offset = 0])
:param int $value: Number of rows to limit the results to
:param int $offset: Number of rows to skip
@@ -1387,7 +1387,7 @@ Class Reference
Adds LIMIT and OFFSET clauses to a query.
- .. method:: offset($offset)
+ .. php:method:: offset($offset)
:param int $offset: Number of rows to skip
:returns: CI_DB_query_builder instance (method chaining)
@@ -1395,7 +1395,7 @@ Class Reference
Adds an OFFSET clause to a query.
- .. method:: set($key[, $value = ''[, $escape = NULL]])
+ .. php:method:: set($key[, $value = ''[, $escape = NULL]])
:param mixed $key: Field name, or an array of field/value pairs
:param string $value: Field value, if $key is a single field
@@ -1406,7 +1406,7 @@ Class Reference
Adds field/value pairs to be passed later to ``insert()``,
``update()`` or ``replace()``.
- .. method:: insert([$table = ''[, $set = NULL[, $escape = NULL]]])
+ .. php:method:: insert([$table = ''[, $set = NULL[, $escape = NULL]]])
:param string $table: Table name
:param array $set: An associative array of field/value pairs
@@ -1416,7 +1416,7 @@ Class Reference
Compiles and executes an INSERT statement.
- .. method:: insert_batch([$table = ''[, $set = NULL[, $escape = NULL]]])
+ .. php:method:: insert_batch([$table = ''[, $set = NULL[, $escape = NULL]]])
:param string $table: Table name
:param array $set: Data to insert
@@ -1426,7 +1426,7 @@ Class Reference
Compiles and executes batch INSERT statements.
- .. method:: set_insert_batch($key[, $value = ''[, $escape = NULL]])
+ .. php:method:: set_insert_batch($key[, $value = ''[, $escape = NULL]])
:param mixed $key: Field name or an array of field/value pairs
:param string $value: Field value, if $key is a single field
@@ -1436,7 +1436,7 @@ Class Reference
Adds field/value pairs to be inserted in a table later via ``insert_batch()``.
- .. method:: update([$table = ''[, $set = NULL[, $where = NULL[, $limit = NULL]]]])
+ .. php:method:: update([$table = ''[, $set = NULL[, $where = NULL[, $limit = NULL]]]])
:param string $table: Table name
:param array $set: An associative array of field/value pairs
@@ -1447,7 +1447,7 @@ Class Reference
Compiles and executes an UPDATE statement.
- .. method:: update_batch([$table = ''[, $set = NULL[, $value = NULL]]])
+ .. php:method:: update_batch([$table = ''[, $set = NULL[, $value = NULL]]])
:param string $table: Table name
:param array $set: Field name, or an associative array of field/value pairs
@@ -1457,7 +1457,7 @@ Class Reference
Compiles and executes batch UPDATE statements.
- .. method:: set_update_batch($key[, $value = ''[, $escape = NULL]])
+ .. php:method:: set_update_batch($key[, $value = ''[, $escape = NULL]])
:param mixed $key: Field name or an array of field/value pairs
:param string $value: Field value, if $key is a single field
@@ -1467,7 +1467,7 @@ Class Reference
Adds field/value pairs to be updated in a table later via ``update_batch()``.
- .. method:: replace([$table = ''[, $set = NULL]])
+ .. php:method:: replace([$table = ''[, $set = NULL]])
:param string $table: Table name
:param array $set: An associative array of field/value pairs
@@ -1476,7 +1476,7 @@ Class Reference
Compiles and executes a REPLACE statement.
- .. method:: delete([$table = ''[, $where = ''[, $limit = NULL[, $reset_data = TRUE]]]])
+ .. php:method:: delete([$table = ''[, $where = ''[, $limit = NULL[, $reset_data = TRUE]]]])
:param mixed $table: The table(s) to delete from; string or array
:param string $where: The WHERE clause
@@ -1487,7 +1487,7 @@ Class Reference
Compiles and executes a DELETE query.
- .. method:: truncate([$table = ''])
+ .. php:method:: truncate([$table = ''])
:param string $table: Table name
:returns: TRUE on success, FALSE on failure
@@ -1498,7 +1498,7 @@ Class Reference
.. note:: If the database platform in use doesn't support TRUNCATE,
a DELETE statement will be used instead.
- .. method:: empty_table([$table = ''])
+ .. php:method:: empty_table([$table = ''])
:param string $table: Table name
:returns: TRUE on success, FALSE on failure
@@ -1506,7 +1506,7 @@ Class Reference
Deletes all records from a table via a DELETE statement.
- .. method:: get_compiled_select([$table = ''[, $reset = TRUE]])
+ .. php:method:: get_compiled_select([$table = ''[, $reset = TRUE]])
:param string $table: Table name
:param bool $reset: Whether to reset the current QB values or not
@@ -1515,7 +1515,7 @@ Class Reference
Compiles a SELECT statement and returns it as a string.
- .. method:: get_compiled_insert([$table = ''[, $reset = TRUE]])
+ .. php:method:: get_compiled_insert([$table = ''[, $reset = TRUE]])
:param string $table: Table name
:param bool $reset: Whether to reset the current QB values or not
@@ -1524,7 +1524,7 @@ Class Reference
Compiles an INSERT statement and returns it as a string.
- .. method:: get_compiled_update([$table = ''[, $reset = TRUE]])
+ .. php:method:: get_compiled_update([$table = ''[, $reset = TRUE]])
:param string $table: Table name
:param bool $reset: Whether to reset the current QB values or not
@@ -1533,7 +1533,7 @@ Class Reference
Compiles an UPDATE statement and returns it as a string.
- .. method:: get_compiled_delete([$table = ''[, $reset = TRUE]])
+ .. php:method:: get_compiled_delete([$table = ''[, $reset = TRUE]])
:param string $table: Table name
:param bool $reset: Whether to reset the current QB values or not
diff --git a/user_guide_src/source/database/results.rst b/user_guide_src/source/database/results.rst
index ae81998c7..a22c2e8c3 100644
--- a/user_guide_src/source/database/results.rst
+++ b/user_guide_src/source/database/results.rst
@@ -245,9 +245,9 @@ TRUE on success or FALSE on failure.
Class Reference
***************
-.. class:: CI_DB_result
+.. php:class:: CI_DB_result
- .. method:: result([$type = 'object'])
+ .. php:method:: result([$type = 'object'])
:param string $type: Type of requested results - array, object, or class name
:returns: Array containing the fetched rows
@@ -258,7 +258,7 @@ Class Reference
Usage: see `Result Arrays`_.
- .. method:: result_array()
+ .. php:method:: result_array()
:returns: Array containing the fetched rows
:rtype: array
@@ -268,7 +268,7 @@ Class Reference
Usage: see `Result Arrays`_.
- .. method:: result_object()
+ .. php:method:: result_object()
:returns: Array containing the fetched rows
:rtype: array
@@ -278,7 +278,7 @@ Class Reference
Usage: see `Result Arrays`_.
- .. method:: custom_result_object($class_name)
+ .. php:method:: custom_result_object($class_name)
:param string $class_name: Class name for the resulting rows
:returns: Array containing the fetched rows
@@ -287,7 +287,7 @@ Class Reference
Returns the query results as an array of rows, where each
row is an instance of the specified class.
- .. method:: row([$n = 0[, $type = 'object']])
+ .. php:method:: row([$n = 0[, $type = 'object']])
:param int $n: Index of the query results row to be returned
:param string $type: Type of the requested result - array, object, or class name
@@ -299,7 +299,7 @@ Class Reference
Usage: see `Result Rows`_.
- .. method:: unbuffered_row([$type = 'object'])
+ .. php:method:: unbuffered_row([$type = 'object'])
:param string $type: Type of the requested result - array, object, or class name
:returns: Next row from the result set or NULL if it doesn't exist
@@ -310,7 +310,7 @@ Class Reference
Usage: see `Result Rows`_.
- .. method:: row_array([$n = 0])
+ .. php:method:: row_array([$n = 0])
:param int $n: Index of the query results row to be returned
:returns: The requested row or NULL if it doesn't exist
@@ -320,7 +320,7 @@ Class Reference
Usage: see `Result Rows`_.
- .. method:: row_object([$n = 0])
+ .. php:method:: row_object([$n = 0])
:param int $n: Index of the query results row to be returned
:returns: The requested row or NULL if it doesn't exist
@@ -331,7 +331,7 @@ Class Reference
Usage: see `Result Rows`_.
- .. method:: custom_row_object($n, $type)
+ .. php:method:: custom_row_object($n, $type)
:param int $n: Index of the results row to return
:param string $class_name: Class name for the resulting row
@@ -341,7 +341,7 @@ Class Reference
Returns the requested result row as an instance of the
requested class.
- .. method:: data_seek([$n = 0])
+ .. php:method:: data_seek([$n = 0])
:param int $n: Index of the results row to be returned next
:returns: TRUE on success, FALSE on failure
@@ -351,7 +351,7 @@ Class Reference
Usage: see `Result Helper Methods`_.
- .. method:: set_row($key[, $value = NULL])
+ .. php:method:: set_row($key[, $value = NULL])
:param mixed $key: Column name or array of key/value pairs
:param mixed $value: Value to assign to the column, $key is a single field name
@@ -359,7 +359,7 @@ Class Reference
Assigns a value to a particular column.
- .. method:: next_row([$type = 'object'])
+ .. php:method:: next_row([$type = 'object'])
:param string $type: Type of the requested result - array, object, or class name
:returns: Next row of result set, or NULL if it doesn't exist
@@ -367,7 +367,7 @@ Class Reference
Returns the next row from the result set.
- .. method:: previous_row([$type = 'object'])
+ .. php:method:: previous_row([$type = 'object'])
:param string $type: Type of the requested result - array, object, or class name
:returns: Previous row of result set, or NULL if it doesn't exist
@@ -375,7 +375,7 @@ Class Reference
Returns the previous row from the result set.
- .. method:: first_row([$type = 'object'])
+ .. php:method:: first_row([$type = 'object'])
:param string $type: Type of the requested result - array, object, or class name
:returns: First row of result set, or NULL if it doesn't exist
@@ -383,7 +383,7 @@ Class Reference
Returns the first row from the result set.
- .. method:: last_row([$type = 'object'])
+ .. php:method:: last_row([$type = 'object'])
:param string $type: Type of the requested result - array, object, or class name
:returns: Last row of result set, or NULL if it doesn't exist
@@ -391,7 +391,7 @@ Class Reference
Returns the last row from the result set.
- .. method:: num_rows()
+ .. php:method:: num_rows()
:returns: Number of rows in the result set
:rtype: int
@@ -400,7 +400,7 @@ Class Reference
Usage: see `Result Helper Methods`_.
- .. method:: num_fields()
+ .. php:method:: num_fields()
:returns: Number of fields in the result set
:rtype: int
@@ -409,7 +409,7 @@ Class Reference
Usage: see `Result Helper Methods`_.
- .. method:: field_data()
+ .. php:method:: field_data()
:returns: Array containing field meta-data
:rtype: array
@@ -417,7 +417,7 @@ Class Reference
Generates an array of ``stdClass`` objects containing
field meta-data.
- .. method:: free_result()
+ .. php:method:: free_result()
:rtype: void
@@ -425,7 +425,7 @@ Class Reference
Usage: see `Result Helper Methods`_.
- .. method:: list_fields()
+ .. php:method:: list_fields()
:returns: Array of column names
:rtype: array
diff --git a/user_guide_src/source/database/utilities.rst b/user_guide_src/source/database/utilities.rst
index 0d8137dd7..2da1f981d 100644
--- a/user_guide_src/source/database/utilities.rst
+++ b/user_guide_src/source/database/utilities.rst
@@ -247,9 +247,9 @@ Preference Default Value Options Descript
Class Reference
***************
-.. class:: CI_DB_utility
+.. php:class:: CI_DB_utility
- .. method:: backup([$params = array()])
+ .. php:method:: backup([$params = array()])
:param array $params: An associative array of options
:returns: void
@@ -257,7 +257,7 @@ Class Reference
Perform a database backup, per user preferences.
- .. method:: database_exists($database_name)
+ .. php:method:: database_exists($database_name)
:param string $database_name: Database name
:returns: TRUE if the database exists, FALSE otherwise
@@ -265,21 +265,21 @@ Class Reference
Check for the existence of a database.
- .. method:: list_databases()
+ .. php:method:: list_databases()
:returns: Array of database names found
:rtype: array
Retrieve a list of all the database names.
- .. method:: optimize_database()
+ .. php:method:: optimize_database()
:returns: Array of optimization messages or FALSE on failure
:rtype: array
Optimizes the database.
- .. method:: optimize_table($table_name)
+ .. php:method:: optimize_table($table_name)
:param string $table_name: Name of the table to optimize
:returns: Array of optimization messages or FALSE on failure
@@ -287,7 +287,7 @@ Class Reference
Optimizes a database table.
- .. method:: repair_table($table_name)
+ .. php:method:: repair_table($table_name)
:param string $table_name: Name of the table to repair
:returns: Array of repair messages or FALSE on failure
@@ -295,7 +295,7 @@ Class Reference
Repairs a database table.
- .. method:: csv_from_results($query[, $delim = ','[, $newline = "\n"[, $enclosure = '"']]])
+ .. php:method:: csv_from_results($query[, $delim = ','[, $newline = "\n"[, $enclosure = '"']]])
:param object $query: A database result object
:param string $delim: The CSV field delimiter to use
@@ -306,7 +306,7 @@ Class Reference
Translates a database result object into a CSV document.
- .. method:: xml_from_results($query[, $params = array()])
+ .. php:method:: xml_from_results($query[, $params = array()])
:param object $query: A database result object
:param array $params: An associative array of preferences