CI_DB_driver::table_exists()

table_exists($table_name) Parameters: $table_name (string) – The table name Returns: TRUE if that table exists, FALSE if not Return type: bool Determine if a particular table exists.

CI_DB_driver::simple_query()

simple_query($sql) Parameters: $sql (string) – The SQL statement to execute Returns: Whatever the underlying driver’s “query” function returns Return type: mixed A simplified version of the query() method, appropriate 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.

CI_DB_driver::reconnect()

reconnect() Returns: TRUE on success, FALSE on failure Return type: bool Keep / reestablish the database connection if no queries have been sent for a length of time exceeding the server’s idle timeout.

CI_DB_driver::query()

query($sql[, $binds = FALSE[, $return_object = NULL]]) Parameters: $sql (string) – The SQL statement to execute $binds (array) – An array of binding data $return_object (bool) – Whether to return a result object or not Returns: TRUE for successful “write-type” queries, CI_DB_result instance (method chaining) on “query” success, FALSE on failure Return type: mixed Execute an SQL query. Accepts an SQL string as input and returns a result object upon successful execution of a “read”

CI_DB_driver::protect_identifiers()

protect_identifiers($item[, $prefix_single = FALSE[, $protect_identifiers = NULL[, $field_exists = TRUE]]]) Parameters: $item (string) – The item to work with $prefix_single (bool) – Whether to apply the dbprefix even if the input item is a single identifier $protect_identifiers (bool) – Whether to quote identifiers $field_exists (bool) – Whether the supplied item contains a field name or not Returns: The modified item Return type: string Takes a column or table name (optionally

CI_DB_driver::primary()

primary($table) Parameters: $table (string) – Table name Returns: The primary key name, FALSE if none Return type: string Retrieves the primary key of a table. Note If the database platform does not support primary key detection, the first column name may be assumed as the primary key.

CI_DB_driver::platform()

platform() Returns: Platform name Return type: string The name of the platform in use (mysql, mssql, etc...).

CI_DB_driver::list_tables()

list_tables([$constrain_by_prefix = FALSE]) Parameters: $constrain_by_prefix (bool) – TRUE to match table names by the configured dbprefix Returns: Array of table names or FALSE on failure Return type: array Gets a list of the tables in the current database.

CI_DB_driver::list_fields()

list_fields($table) Parameters: $table (string) – The table name Returns: Array of field names or FALSE on failure Return type: array Gets a list of the field names in a table.

CI_DB_driver::last_query()

last_query() Returns: The last query executed Return type: string Returns the last query that was executed.