CI_DB_mysql_driver Class Reference

List of all members.

Public Member Functions

 db_connect ()
 db_pconnect ()
 db_select ()
 db_set_charset ($charset, $collation)
 _version ()
 _execute ($sql)
 _prep_query ($sql)
 trans_begin ($test_mode=FALSE)
 trans_commit ()
 trans_rollback ()
 escape_str ($str)
 affected_rows ()
 insert_id ()
 count_all ($table= '')
 _list_tables ($prefix_limit=FALSE)
 _list_columns ($table= '')
 _field_data ($table)
 _error_message ()
 _error_number ()
 _escape_identifiers ($item)
 _from_tables ($tables)
 _insert ($table, $keys, $values)
 _update ($table, $values, $where, $orderby=array(), $limit=FALSE)
 _truncate ($table)
 _delete ($table, $where=array(), $like=array(), $limit=FALSE)
 _limit ($sql, $limit, $offset)
 _close ($conn_id)

Public Attributes

 $dbdriver = 'mysql'
 $_escape_char = '`'
 $delete_hack = TRUE
 $_count_string = 'SELECT COUNT(*) AS '
 $_random_keyword = ' RAND()'


Member Function Documentation

CI_DB_mysql_driver::_close ( conn_id  ) 

Close DB Connection

public

Parameters:
resource 
Returns:
void

CI_DB_mysql_driver::_delete ( table,
where = array(),
like = array(),
limit = FALSE 
)

Delete statement

Generates a platform-specific delete string from the supplied data

public

Parameters:
string the table name
array the where clause
string the limit clause
Returns:
string

CI_DB_mysql_driver::_error_message (  ) 

The error message string

private

Returns:
string

CI_DB_mysql_driver::_error_number (  ) 

The error message number

private

Returns:
integer

CI_DB_mysql_driver::_escape_identifiers ( item  ) 

Escape the SQL Identifiers

This function escapes column and table names

private

Parameters:
string 
Returns:
string

CI_DB_mysql_driver::_execute ( sql  ) 

Execute the query

private called by the base class

Parameters:
string an SQL query
Returns:
resource

CI_DB_mysql_driver::_field_data ( table  ) 

Field data query

Generates a platform-specific query so that the column data can be retrieved

public

Parameters:
string the table name
Returns:
object

CI_DB_mysql_driver::_from_tables ( tables  ) 

From Tables

This function implicitly groups FROM tables so there is no confusion about operator precedence in harmony with SQL standards

public

Parameters:
type 
Returns:
type

CI_DB_mysql_driver::_insert ( table,
keys,
values 
)

Insert statement

Generates a platform-specific insert string from the supplied data

public

Parameters:
string the table name
array the insert keys
array the insert values
Returns:
string

CI_DB_mysql_driver::_limit ( sql,
limit,
offset 
)

Limit string

Generates a platform-specific LIMIT clause

public

Parameters:
string the sql query string
integer the number of rows to limit the query to
integer the offset value
Returns:
string

CI_DB_mysql_driver::_list_columns ( table = ''  ) 

Show column query

Generates a platform-specific query string so that the column names can be fetched

public

Parameters:
string the table name
Returns:
string

CI_DB_mysql_driver::_list_tables ( prefix_limit = FALSE  ) 

List table query

Generates a platform-specific query string so that the table names can be fetched

private

Parameters:
boolean 
Returns:
string

CI_DB_mysql_driver::_prep_query ( sql  ) 

Prep the query

If needed, each database adapter can prep the query string

private called by execute()

Parameters:
string an SQL query
Returns:
string

CI_DB_mysql_driver::_truncate ( table  ) 

Truncate statement

Generates a platform-specific truncate string from the supplied data If the database does not support the truncate() command This function maps to "DELETE FROM table"

public

Parameters:
string the table name
Returns:
string

CI_DB_mysql_driver::_update ( table,
values,
where,
orderby = array(),
limit = FALSE 
)

Update statement

Generates a platform-specific update string from the supplied data

public

Parameters:
string the table name
array the update data
array the where clause
array the orderby clause
array the limit clause
Returns:
string

CI_DB_mysql_driver::_version (  ) 

Version number query string

public

Returns:
string

CI_DB_mysql_driver::affected_rows (  ) 

Affected Rows

public

Returns:
integer

CI_DB_mysql_driver::count_all ( table = ''  ) 

"Count All" query

Generates a platform-specific query string that counts all records in the specified database

public

Parameters:
string 
Returns:
string

CI_DB_mysql_driver::db_connect (  ) 

Non-persistent database connection

private called by the base class

Returns:
resource

CI_DB_mysql_driver::db_pconnect (  ) 

Persistent database connection

private called by the base class

Returns:
resource

CI_DB_mysql_driver::db_select (  ) 

Select the database

private called by the base class

Returns:
resource

CI_DB_mysql_driver::db_set_charset ( charset,
collation 
)

Set client character set

public

Parameters:
string 
string 
Returns:
resource

CI_DB_mysql_driver::escape_str ( str  ) 

Escape String

public

Parameters:
string 
Returns:
string

CI_DB_mysql_driver::insert_id (  ) 

Insert ID

public

Returns:
integer

CI_DB_mysql_driver::trans_begin ( test_mode = FALSE  ) 

Begin Transaction

public

Returns:
bool

CI_DB_mysql_driver::trans_commit (  ) 

Commit Transaction

public

Returns:
bool

CI_DB_mysql_driver::trans_rollback (  ) 

Rollback Transaction

public

Returns:
bool


Member Data Documentation

CI_DB_mysql_driver::$_count_string = 'SELECT COUNT(*) AS '

The syntax to count rows is slightly different across different database engines, so this string appears in each driver and is used for the count_all() and count_all_results() functions.

CI_DB_mysql_driver::$_escape_char = '`'

CI_DB_mysql_driver::$_random_keyword = ' RAND()'

CI_DB_mysql_driver::$dbdriver = 'mysql'

CI_DB_mysql_driver::$delete_hack = TRUE

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.


The documentation for this class was generated from the following file:

Generated on Sun Nov 16 16:09:10 2008 for CodeIgniter by  doxygen 1.5.7.1