Property | Type | Description | |
---|---|---|---|
$CACHE | object | DB Cache object | |
$benchmark | integer | Benchmark time | |
$bind_marker | string | Character used to identify values in a prepared statement. | |
$cache_autodel | boolean | Cache auto-delete flag | |
$cache_on | boolean | Cache On flag | |
$cachedir | boolean | Cache directory path | |
$char_set | string | Character set | |
$conn_id | object | resource | Connection ID | |
$data_cache | array | An internal generic value cache. | |
$database | string | Database name | |
$db_debug | boolean | Whether to display error messages. | |
$dbcollat | string | Collation | |
$dbdriver | string | Database driver | |
$dbprefix | string | Table prefix | |
$dsn | string | Data Source Name / Connect string | |
$encrypt | mixed | Encryption flag/data | |
$hostname | string | Hostname | |
$password | string | Password | |
$pconnect | boolean | Persistent connection flag | |
$port | integer | Database port | |
$queries | string[] | Queries list | |
$query_count | integer | Executed queries count | |
$query_times | array | A list of times that queries took to execute. | |
$result_id | object | resource | Result ID | |
$save_queries | boolean | Whether to keep an in-memory history of queries for debugging purposes. | |
$subdriver | string | Sub-driver | |
$swap_pre | string | Swap Prefix | |
$trans_enabled | boolean | Transaction enabled flag | |
$trans_strict | boolean | Strict transaction mode flag | |
$username | string | Username |
Property | Type | Description | |
---|---|---|---|
$_count_string | string | COUNT string | |
$_escape_char | string | Identifier escape character | |
$_like_escape_chr | string | ESCAPE character | |
$_like_escape_str | string | ESCAPE statement string | |
$_protect_identifiers | boolean | Protect identifiers flag | |
$_random_keyword | array | ORDER BY random keyword | |
$_reserved_identifiers | string[] | Identifiers that must NOT be escaped. | |
$_trans_depth | integer | Transaction depth level | |
$_trans_failure | boolean | Used with transactions to determine if a transaction has failed. | |
$_trans_status | boolean | Used with transactions to determine if a rollback should occur. |
Method | Description | |
---|---|---|
__construct ( array $params ) : void | Class constructor | |
cache_delete ( string $segment_one = '', string $segment_two = '' ) : boolean | Delete the cache files associated with a particular URI | |
cache_delete_all ( ) : boolean | Delete All cache files | |
cache_off ( ) : boolean | Disable Query Caching | |
cache_on ( ) : boolean | Enable Query Caching | |
cache_set_path ( $path = '' ) : void | Set Cache Directory Path | |
call_function ( string $function ) : mixed | Enables a native PHP function to be run, using a platform agnostic wrapper. | |
close ( ) : void | Close DB Connection | |
compile_binds ( $sql, $binds ) : string | Compile Bindings | |
count_all ( $table = '' ) : integer | "Count All" query | |
db_connect ( ) : mixed | DB connect | |
db_pconnect ( ) : mixed | Persistent database connection | |
db_select ( ) : boolean | Select database | |
db_set_charset ( $charset ) : boolean | Set client character set | |
display_error ( $error = '', $swap = '', $native = FALSE ) : string | Display an error message | |
elapsed_time ( $decimals = 6 ) : string | Calculate the aggregate query elapsed time | |
error ( ) : array | Last error | |
escape ( $str ) : mixed | "Smart" Escape String | |
escape_identifiers ( $item ) : mixed | Escape the SQL Identifiers | |
escape_like_str ( $str ) : mixed | Escape LIKE String | |
escape_str ( string | string[] $str, boolean $like = FALSE ) : string | Escape String | |
field_data ( string $table ) : array | Returns an object with field data | |
field_exists ( $field_name, $table_name ) : boolean | Determine if a particular field exists | |
initialize ( ) : boolean | Initialize Database Settings | |
insert_string ( $table, $data ) : string | Generate an insert string | |
is_write_type ( $sql ) : boolean | Determines if a query is a "write" type. | |
last_query ( ) : string | Returns the last query that was executed | |
list_fields ( string $table ) : array | Fetch Field Names | |
list_tables ( string $constrain_by_prefix = FALSE ) : array | Returns an array of table names | |
load_rdriver ( ) : string | Load the result drivers | |
platform ( ) : string | The name of the platform in use (mysql, mssql, etc. | |
primary ( string $table ) : string | Primary | |
protect_identifiers ( $item, $prefix_single = FALSE, $protect_identifiers = NULL, $field_exists = TRUE ) : string | Protect Identifiers | |
query ( string $sql, array $binds = FALSE, boolean $return_object = NULL ) : mixed | Execute the query | |
reconnect ( ) : void | Reconnect | |
simple_query ( $sql ) : mixed | Simple Query This is a simplified version of the query() function. Internally we only use it when running transaction commands since they do not require all the features of the main query() function. | |
table_exists ( string $table_name ) : boolean | Determine if a particular table exists | |
total_queries ( ) : integer | Returns the total number of queries | |
trans_begin ( boolean $test_mode = FALSE ) : boolean | Begin Transaction | |
trans_commit ( ) : boolean | Commit Transaction | |
trans_complete ( ) : boolean | Complete Transaction | |
trans_off ( ) : void | Disable Transactions This permits transactions to be disabled at run-time. | |
trans_rollback ( ) : boolean | Rollback Transaction | |
trans_start ( boolean $test_mode = FALSE ) : boolean | Start Transaction | |
trans_status ( ) : boolean | Lets you retrieve the transaction flag to determine if it has failed | |
trans_strict ( boolean $mode = TRUE ) : void | Enable/disable Transaction Strict Mode | |
update_string ( $table, $data, $where ) : string | Generate an update string | |
version ( ) : string | Database version number |
Method | Description | |
---|---|---|
_cache_init ( ) : boolean | Initialize the Cache Class | |
_close ( ) : void | Close DB Connection | |
_escape_str ( $str ) : string | Platform-dependant string escape | |
_get_operator ( $str ) : string | Returns the SQL string operator | |
_has_operator ( $str ) : boolean | Tests whether the string has an SQL operator | |
_insert ( $table, $keys, $values ) : string | Insert statement | |
_reset_select ( ) : void | Dummy method that allows Query Builder class to be disabled and keep count_all() working. | |
_update ( $table, $values ) : string | Update statement | |
_version ( ) : string | Version number query string |
public __construct ( array $params ) : void | ||
$params | array | |
return | void |
protected _cache_init ( ) : boolean | ||
return | boolean |
protected _escape_str ( $str ) : string | ||
return | string |
protected _get_operator ( $str ) : string | ||
return | string |
protected _has_operator ( $str ) : boolean | ||
return | boolean |
protected _reset_select ( ) : void | ||
return | void |
public cache_delete_all ( ) : boolean | ||
return | boolean |
public cache_set_path ( $path = '' ) : void | ||
return | void |
public call_function ( string $function ) : mixed | ||
$function | string | Function name |
return | mixed |
public compile_binds ( $sql, $binds ) : string | ||
return | string |
public db_connect ( ) : mixed | ||
return | mixed |
public db_pconnect ( ) : mixed | ||
return | mixed |
public db_set_charset ( $charset ) : boolean | ||
return | boolean |
public display_error ( $error = '', $swap = '', $native = FALSE ) : string | ||
return | string | sends the application/views/errors/error_db.php template |
public elapsed_time ( $decimals = 6 ) : string | ||
return | string |
public escape_identifiers ( $item ) : mixed | ||
return | mixed |
public escape_like_str ( $str ) : mixed | ||
return | mixed |
public field_data ( string $table ) : array | ||
$table | string | the table name |
return | array |
public field_exists ( $field_name, $table_name ) : boolean | ||
return | boolean |
public initialize ( ) : boolean | ||
return | boolean |
public insert_string ( $table, $data ) : string | ||
return | string |
public is_write_type ( $sql ) : boolean | ||
return | boolean |
public last_query ( ) : string | ||
return | string |
public list_fields ( string $table ) : array | ||
$table | string | Table name |
return | array |
public list_tables ( string $constrain_by_prefix = FALSE ) : array | ||
$constrain_by_prefix | string | = FALSE |
return | array |
public load_rdriver ( ) : string | ||
return | string | the name of the result class |
public protect_identifiers ( $item, $prefix_single = FALSE, $protect_identifiers = NULL, $field_exists = TRUE ) : string | ||
return | string |
public simple_query ( $sql ) : mixed | ||
return | mixed |
public table_exists ( string $table_name ) : boolean | ||
$table_name | string | |
return | boolean |
public total_queries ( ) : integer | ||
return | integer |
public trans_begin ( boolean $test_mode = FALSE ) : boolean | ||
$test_mode | boolean | |
return | boolean |
public trans_complete ( ) : boolean | ||
return | boolean |
public trans_rollback ( ) : boolean | ||
return | boolean |
public trans_start ( boolean $test_mode = FALSE ) : boolean | ||
$test_mode | boolean | = FALSE |
return | boolean |
public trans_status ( ) : boolean | ||
return | boolean |
public trans_strict ( boolean $mode = TRUE ) : void | ||
$mode | boolean | = TRUE |
return | void |
public update_string ( $table, $data, $where ) : string | ||
return | string |
protected string $_escape_char | ||
return | string |
protected string $_like_escape_chr | ||
return | string |
protected string $_like_escape_str | ||
return | string |
protected bool $_protect_identifiers | ||
return | boolean |
protected array $_random_keyword | ||
return | array |
protected string[] $_reserved_identifiers | ||
return | string[] |
protected bool $_trans_failure | ||
return | boolean |
protected bool $_trans_status | ||
return | boolean |
public string $bind_marker | ||
return | string |
public array $query_times | ||
return | array |
public bool $save_queries | ||
return | boolean |