Properties

$dependencies

$dependencies : 

Type

$shortcuts

$shortcuts : 

Type

$singleton

$singleton : 

Type

$class_hash

$class_hash : 

Type

$resConnection

$resConnection : 

Type

$blnDisableAutocommit

$blnDisableAutocommit : 

Type

$strTmpPrefix

$strTmpPrefix : 

Type

$strTablePrefix

$strTablePrefix : 

Type

$strDebugPrefix

$strDebugPrefix : 

Type

$strCharset

$strCharset : 

Type

$strDatabase

$strDatabase : 

Type

$strError

$strError : 

Type

$intErrno

$intErrno : 

Type

$intQueryCount

$intQueryCount : 

Type

$strDbalName

$strDbalName : 

Type

$strDbmsName

$strDbmsName : 

Type

$strListTables

$strListTables : string

List tables query

Type

string

$strListFields

$strListFields : string

List fields query

Type

string

$objLogger

$objLogger : 

Type

$blnInConstruct

$blnInConstruct : 

Type

$_shorts

$_shorts : 

Type

$_shorts_loaded

$_shorts_loaded : 

Type

$_class_index

$_class_index : 

Type

Methods

__construct()

__construct(  $arrOptions = array()) 

Parameters

$arrOptions

pdl_html_format_sql_error()

pdl_html_format_sql_error(  $log_entry) 

Parameters

$log_entry

pdl_pt_format_sql_error()

pdl_pt_format_sql_error(  $log_entry) 

Parameters

$log_entry

clean_errormessage()

clean_errormessage(  $strErrorMessage) 

Parameters

$strErrorMessage

highlight()

highlight(  $sql) 

Parameters

$sql

pdl_html_format_sql_query()

pdl_html_format_sql_query(  $log_entry) 

Parameters

$log_entry

__destruct()

__destruct() 

__get()

__get(  $name) 

Parameters

$name

prepare()

prepare(  $strQuery) : \Database_Statement

Prepare a statement (return a Database_Statement object)

Parameters

$strQuery

Returns

\Database_Statement

execute()

execute(  $strQuery) : \Database_Result

Execute a query (return a Database_Result object)

Parameters

$strQuery

Returns

\Database_Result

query()

query(  $strQuery,   $blnGetFirstRow = false) : \Database_Result

Execute a raw query (return a Database_Result object)

Parameters

$strQuery
$blnGetFirstRow

Returns

\Database_Result

checkQuery()

checkQuery(  $strQuery) : boolean

Checks if a Query is executed or not

Parameters

$strQuery

Returns

boolean

listTables()

listTables(  $strDatabase = null) : array

Return all columns of a particular table as array

Parameters

$strDatabase

Returns

array

tableExists()

tableExists(  $strTable,   $strDatabase = null) : boolean

Determine if a particular database table exists

Parameters

$strTable
$strDatabase

Returns

boolean

listFields()

listFields(  $strTable) : array

Return all columns of a particular table as array

Parameters

$strTable

Returns

array

fieldInformation()

fieldInformation(  $strTable) 

Parameters

$strTable

fieldExists()

fieldExists(  $strField,   $strTable) : boolean

Determine if a particular column exists

Parameters

$strField
$strTable

Returns

boolean

getFieldNames()

getFieldNames(  $strTable) : array

Return the field names of a particular table as array

Parameters

$strTable

Returns

array

setDatabase()

setDatabase(  $strDatabase = false) : boolean

Change the current database

Parameters

$strDatabase

Returns

boolean

setPrefix()

setPrefix(  $strPrefix) 

Parameters

$strPrefix

resetPrefix()

resetPrefix() 

beginTransaction()

beginTransaction() 

Begin a transaction

commitTransaction()

commitTransaction() 

Commit a transaction

rollbackTransaction()

rollbackTransaction() 

Rollback a transaction

getSizeOf()

getSizeOf(  $strTable) : integer

Return the table size in bytes

Parameters

$strTable

Returns

integer

getNextId()

getNextId(  $strTable) : integer

Return the next autoincrement ID of a table

Parameters

$strTable

Returns

integer

showCreateTable()

showCreateTable(  $strTable) 

Parameters

$strTable

isEQdkpTable()

isEQdkpTable(  $strTable) 

Parameters

$strTable

escapeString()

escapeString(  $strString) 

Parameters

$strString

connect()

connect(  $strHost,   $strDatabase,   $strUser,   $strPassword,   $intPort = false,   $blnPersistent = false) 

Connect to the database server and select the database

Parameters

$strHost
$strDatabase
$strUser
$strPassword
$intPort
$blnPersistent

__isset()

__isset(  $name) 

Parameters

$name

__dependencies()

__dependencies() 

__shortcuts()

__shortcuts() 

error()

error(  $strErrorMessage,   $strQuery,   $strErrorCode = '') 

Parameters

$strErrorMessage
$strQuery
$strErrorCode

disconnect()

disconnect() 

Disconnect from the database

get_client_version()

get_client_version() 

get_server_version()

get_server_version() 

get_error()

get_error() : string

Return the last error message

Returns

string

get_connerror()

get_connerror() 

begin_transaction()

begin_transaction() 

Begin a transaction

commit_transaction()

commit_transaction() 

Commit a transaction

rollback_transaction()

rollback_transaction() 

Rollback a transaction

list_fields()

list_fields(  $strTable) : array

Return a standardized array with field information

Standardized format:

  • name: field name (e.g. my_field)
  • type: field type (e.g. "int" or "number")
  • length: field length (e.g. 20)
  • precision: precision of a float number (e.g. 5)
  • null: NULL or NOT NULL
  • default: default value (e.g. "default_value")
  • attributes: attributes (e.g. "unsigned")
  • index: PRIMARY, UNIQUE or INDEX
  • extra: extra information (e.g. auto_increment)
  • numeric: true/false

Parameters

$strTable

Returns

array

field_information()

field_information(  $strTable) 

Parameters

$strTable

set_database()

set_database(  $strDatabase = false) : boolean

Change the current database

Parameters

$strDatabase

Returns

boolean

get_size_of()

get_size_of(  $strTable) : integer

Return the table size in bytes

Parameters

$strTable

Returns

integer

get_next_id()

get_next_id(  $strTable) : integer

Return the next autoincrement ID of a table

Parameters

$strTable

Returns

integer

createStatement()

createStatement(  $resConnection,   $strTablePrefix,   $strDebugPrefix,   $blnDisableAutocommit) : \DB_Mysql_PDO_Old_Statement

Create a Database_Statement object

Parameters

$resConnection
$strTablePrefix
$strDebugPrefix
$blnDisableAutocommit

Returns

\DB_Mysql_PDO_Old_Statement

show_create_table()

show_create_table(  $strTable) 

Parameters

$strTable

get_errno()

get_errno() 

find_in_set()

find_in_set(  $strKey,   $strSet,   $blnIsField = false) : string

Auto-generate a FIND_IN_SET() statement

Parameters

$strKey
$strSet
$blnIsField

Returns

string

lock_tables()

lock_tables(  $arrTables) 

Lock one or more tables

Parameters

$arrTables

unlock_tables()

unlock_tables() 

Unlock all tables