CI_DB_utility::backup()

backup([$params = array()]) Parameters: $params (array) – An associative array of options Returns: raw/(g)zipped SQL query string Return type: string Perform a database backup, per user preferences.

CI_DB_utility::csv_from_result()

csv_from_result($query[, $delim = ', '[, $newline = "n"[, $enclosure = '"']]]) Parameters: $query (object) – A database result object $delim (string) – The CSV field delimiter to use $newline (string) – The newline character to use $enclosure (string) – The enclosure delimiter to use Returns: The generated CSV file as a string Return type: string Translates a database result object into a CSV document.

CI_DB_utility

class CI_DB_utility backup([$params = array()]) Parameters: $params (array) – An associative array of options Returns: raw/(g)zipped SQL query string Return type: string Perform a database backup, per user preferences. database_exists($database_name) Parameters: $database_name (string) – Database name Returns: TRUE if the database exists, FALSE otherwise Return type: bool Check for the existence of a database. list_databases() Returns: Array of database names fou

CI_DB_utility::optimize_table()

optimize_table($table_name) Parameters: $table_name (string) – Name of the table to optimize Returns: Array of optimization messages or FALSE on failure Return type: array Optimizes a database table.

CI_DB_utility::database_exists()

database_exists($database_name) Parameters: $database_name (string) – Database name Returns: TRUE if the database exists, FALSE otherwise Return type: bool Check for the existence of a database.

CI_DB_utility::list_databases()

list_databases() Returns: Array of database names found Return type: array Retrieve a list of all the database names.

CI_DB_result::unbuffered_row()

unbuffered_row([$type = 'object']) Parameters: $type (string) – Type of the requested result - array, object, or class name Returns: Next row from the result set or NULL if it doesn’t exist Return type: mixed Fetches the next result row and returns it in the requested form. Usage: see Result Rows.

CI_DB_result::result_array()

result_array() Returns: Array containing the fetched rows Return type: array Returns the query results as an array of rows, where each row is itself an associative array. Usage: see Result Arrays.

CI_DB_result::row_array()

row_array([$n = 0]) Parameters: $n (int) – Index of the query results row to be returned Returns: The requested row or NULL if it doesn’t exist Return type: array Returns the requested result row as an associative array. Usage: see Result Rows.

CI_DB_result::row()

row([$n = 0[, $type = 'object']]) Parameters: $n (int) – Index of the query results row to be returned $type (string) – Type of the requested result - array, object, or class name Returns: The requested row or NULL if it doesn’t exist Return type: mixed A wrapper for the row_array(), row_object() and ``custom_row_object() methods. Usage: see Result Rows.