PHP Class CI_DB_mysqli_driver, TastyIgniter

Note: _DB is an extender class that the app controller creates dynamically based on whether the active record class is being used or not.
Author: ExpressionEngine Dev Team
Inheritance: extends CI_DB
ファイルを表示 Open project: tastyigniter/tastyigniter Class Usage Examples

Public Properties

Property Type Description
$compress boolean Compression flag
$dbdriver string Database driver
$delete_hack boolean Whether to use the MySQL "delete hack" which allows the number of affected rows to be shown. Uses a preg_replace when enabled, adding a bit more processing to all queries.
$stricton boolean Whether we're running in strict SQL mode.

Protected Properties

Property Type Description
$_escape_char string Identifier escape character
$_mysqli MySQLi Has to be preserved without being assigned to $conn_id.

Public Methods

Method Description
affected_rows ( ) : integer Affected Rows
db_connect ( boolean $persistent = FALSE ) : object Database connection
db_select ( string $database = '' ) : boolean Select the database
error ( ) : array Error
field_data ( string $table ) : array Returns an object with field data
insert_id ( ) : integer Insert ID
reconnect ( ) : void Reconnect
version ( ) : string Database version number

Protected Methods

Method Description
_close ( ) : void Close DB Connection
_db_set_charset ( string $charset ) : boolean Set client character set
_escape_str ( $str ) : string Platform-dependant string escape
_execute ( string $sql ) : mixed Execute the query
_from_tables ( ) : string FROM tables
_list_columns ( string $table = '' ) : string Show column query
_list_tables ( boolean $prefix_limit = FALSE ) : string List table query
_prep_query ( string $sql ) : string Prep the query
_trans_begin ( ) : boolean Begin Transaction
_trans_commit ( ) : boolean Commit Transaction
_trans_rollback ( ) : boolean Rollback Transaction

Method Details

_close() protected method

Close DB Connection
protected _close ( ) : void
return void

_db_set_charset() protected method

Set client character set
protected _db_set_charset ( string $charset ) : boolean
$charset string
return boolean

_escape_str() protected method

Platform-dependant string escape
protected _escape_str ( $str ) : string
return string

_execute() protected method

Execute the query
protected _execute ( string $sql ) : mixed
$sql string an SQL query
return mixed

_from_tables() protected method

Groups tables in FROM clauses if needed, so there is no confusion about operator precedence.
protected _from_tables ( ) : string
return string

_list_columns() protected method

Generates a platform-specific query string so that the column names can be fetched
protected _list_columns ( string $table = '' ) : string
$table string
return string

_list_tables() protected method

Generates a platform-specific query string so that the table names can be fetched
protected _list_tables ( boolean $prefix_limit = FALSE ) : string
$prefix_limit boolean
return string

_prep_query() protected method

If needed, each database adapter can prep the query string
protected _prep_query ( string $sql ) : string
$sql string an SQL query
return string

_trans_begin() protected method

Begin Transaction
protected _trans_begin ( ) : boolean
return boolean

_trans_commit() protected method

Commit Transaction
protected _trans_commit ( ) : boolean
return boolean

_trans_rollback() protected method

Rollback Transaction
protected _trans_rollback ( ) : boolean
return boolean

affected_rows() public method

Affected Rows
public affected_rows ( ) : integer
return integer

db_connect() public method

Database connection
public db_connect ( boolean $persistent = FALSE ) : object
$persistent boolean
return object

db_select() public method

Select the database
public db_select ( string $database = '' ) : boolean
$database string
return boolean

error() public method

Returns an array containing code and message of the last database error that has occurred.
public error ( ) : array
return array

field_data() public method

Returns an object with field data
public field_data ( string $table ) : array
$table string
return array

insert_id() public method

Insert ID
public insert_id ( ) : integer
return integer

reconnect() public method

Keep / reestablish the db connection if no queries have been sent for a length of time exceeding the server's idle timeout
public reconnect ( ) : void
return void

version() public method

Database version number
public version ( ) : string
return string

Property Details

$_escape_char protected_oe property

Identifier escape character
protected string $_escape_char
return string

$_mysqli protected_oe property

Has to be preserved without being assigned to $conn_id.
protected MySQLi $_mysqli
return MySQLi

$compress public_oe property

Compression flag
public bool $compress
return boolean

$dbdriver public_oe property

Database driver
public string $dbdriver
return string

$delete_hack public_oe property

Whether to use the MySQL "delete hack" which allows the number of affected rows to be shown. Uses a preg_replace when enabled, adding a bit more processing to all queries.
public bool $delete_hack
return boolean

$stricton public_oe property

Whether we're running in strict SQL mode.
public bool $stricton
return boolean