CI_DB_query_builder::dbprefix()

dbprefix([$table = '']) Parameters: $table (string) – The table name to prefix Returns: The prefixed table name Return type: string Prepends a database prefix, if one exists in configuration.

CI_DB_forge::rename_table()

rename_table($table_name, $new_table_name) Parameters: $table (string) – Current of the table $new_table_name (string) – New name of the table Returns: TRUE on success, FALSE on failure Return type: bool Renames a table. Usage: See Renaming a table.

CI_DB_forge::modify_column()

modify_column($table, $field) Parameters: $table (string) – Table name $field (array) – Column definition(s) Returns: TRUE on success, FALSE on failure Return type: bool Modifies a table column. Usage: See Modifying a Column in a Table.

CI_DB_forge::drop_table()

drop_table($table_name[, $if_exists = FALSE]) Parameters: $table (string) – Name of the table to drop $if_exists (string) – Set to TRUE to add an ‘IF EXISTS’ clause Returns: TRUE on success, FALSE on failure Return type: bool Drops a table. Usage: See Dropping a table.

CI_DB_forge::create_database()

create_database($db_name) Parameters: $db_name (string) – Name of the database to create Returns: TRUE on success, FALSE on failure Return type: bool Creates a new database. Usage: See Creating and Dropping Databases.

CI_DB_forge::drop_database()

drop_database($db_name) Parameters: $db_name (string) – Name of the database to drop Returns: TRUE on success, FALSE on failure Return type: bool Drops a database. Usage: See Creating and Dropping Databases.

CI_DB_forge::create_table()

create_table($table[, $if_not_exists = FALSE[, array $attributes = array()]]) Parameters: $table (string) – Name of the table to create $if_not_exists (string) – Set to TRUE to add an ‘IF NOT EXISTS’ clause $attributes (string) – An associative array of table attributes Returns: TRUE on success, FALSE on failure Return type: bool Creates a new table. Usage: See Creating a table.

CI_DB_forge::add_field()

add_field($field) Parameters: $field (array) – Field definition to add Returns: CI_DB_forge instance (method chaining) Return type: CI_DB_forge Adds a field to the set that will be used to create a table. Usage: See Adding fields.

CI_DB_forge::add_key()

add_key($key[, $primary = FALSE]) Parameters: $key (array) – Name of a key field $primary (bool) – Set to TRUE if it should be a primary key or a regular one Returns: CI_DB_forge instance (method chaining) Return type: CI_DB_forge Adds a key to the set that will be used to create a table. Usage: See Adding Keys.

CI_DB_forge::drop_column()

drop_column($table, $column_name) Parameters: $table (string) – Table name $column_name (array) – The column name to drop Returns: TRUE on success, FALSE on failure Return type: bool Drops a column from a table. Usage: See Dropping a Column From a Table.