Class MysqlDBAdapter

Description

DB access for MySQL

  • version: 1.0

Located in /environment/library/database/adapters/MysqlDBAdapter.class.php (line 9)

AbstractDBAdapter
   |
   --MysqlDBAdapter
Method Summary
integer affectedRows (void 0)
null connect (array $params)
boolean dropTables (mixed $table_names)
boolean emptyTables (mixed $table_names)
string escapeField (string $field)
string escapeValue (mixed $unescaped)
mixed executeQuery (string $sql)
array exportDatabaseStructure (void 0)
string exportTableStructure (string $table_name)
array fetchRow (resource $resource)
boolean freeResult (resource $resource)
string getBeginWorkCommand (void 0)
string getCommitCommand (void 0)
string getRollbackCommand (void 0)
boolean importDatabaseStructure (AbstractDBAdapter $adapter, [boolean $clear = false])
string lastError (void 0)
integer lastErrorCode (void 0)
integer lastInsertId (void 0)
array listTables (void 0)
integer numRows (resource $resource)
Variables
Methods
affectedRows (line 97)

Return number of affected rows

  • access: public
integer affectedRows (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::affectedRows()
Return number of affected rows
connect (line 19)

Connect to the database based on the params array

  • throws: DBConnectError
  • access: protected
null connect (array $params)
  • array $params

Redefinition of:
AbstractDBAdapter::connect()
Connect to the database based on the params array
dropTables (line 160)

Drop one or more tables. If $table_names is string only that table will be droped, else script will drop

  • access: public
boolean dropTables (mixed $table_names)
  • mixed $table_names: Array of table names or single table name

Redefinition of:
AbstractDBAdapter::dropTables()
Drop one or more tables. If $table_names is string only that table will be droped, else script will drop
emptyTables (line 180)

Remove all data from specific tables

  • access: public
boolean emptyTables (mixed $table_names)
  • mixed $table_names: Single table name or array of table names

Redefinition of:
AbstractDBAdapter::emptyTables()
Remove all data from specific tables
escapeField (line 246)

Escape name of table field or name of the table

  • access: public
string escapeField (string $field)
  • string $field

Redefinition of:
AbstractDBAdapter::escapeField()
Escape name of table field or name of the table
escapeValue (line 258)

Escape value before use it in query. This function makes difference between NULL, scalar and DateTime values

  • access: public
string escapeValue (mixed $unescaped)
  • mixed $unescaped: Value that need to be escaped

Redefinition of:
AbstractDBAdapter::escapeValue()
Escape value before use it in query. This function makes difference between NULL, scalar and DateTime values
executeQuery (line 53)

Basic query execution

  • access: protected
mixed executeQuery (string $sql)
  • string $sql

Redefinition of:
AbstractDBAdapter::executeQuery()
Basic query execution
exportDatabaseStructure (line 200)

This function will return array of table names and their CREATE TABLE commands

  • return: or NULL if there are no tables in database
  • access: public
array exportDatabaseStructure (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::exportDatabaseStructure()
This function will return array of table names and their CREATE TABLE commands
exportTableStructure (line 234)

Return CREATE TABLE sql for specific table

  • return: or NULL if table does not exists
  • access: public
string exportTableStructure (string $table_name)
  • string $table_name

Redefinition of:
AbstractDBAdapter::exportTableStructure()
Return CREATE TABLE sql for specific table
fetchRow (line 287)

Fetch row from query result

  • access: public
array fetchRow (resource $resource)
  • resource $resource

Redefinition of:
AbstractDBAdapter::fetchRow()
Fetch row from query result
freeResult (line 309)

Free database result

  • access: public
boolean freeResult (resource $resource)
  • resource $resource

Redefinition of:
AbstractDBAdapter::freeResult()
Free database result
getBeginWorkCommand (line 64)

Get begin work SQL (start transaction)

  • access: public
string getBeginWorkCommand (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::getBeginWorkCommand()
Get begin work SQL (start transaction)
getCommitCommand (line 75)

Get comming SQL

  • access: public
string getCommitCommand (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::getCommitCommand()
Get comming SQL
getRollbackCommand (line 86)

Get rollback SQL

  • access: public
string getRollbackCommand (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::getRollbackCommand()
Get rollback SQL
importDatabaseStructure (line 219)

This function is able to import database construction from any connected adapter

  • access: public
boolean importDatabaseStructure (AbstractDBAdapter $adapter, [boolean $clear = false])

Redefinition of:
AbstractDBAdapter::importDatabaseStructure()
This function is able to import database construction from any connected adapter
lastError (line 119)

Returns last error message that server thrown

  • access: public
string lastError (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::lastError()
Returns last error message that server thrown
lastErrorCode (line 130)

Returns code of the last error

  • access: public
integer lastErrorCode (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::lastErrorCode()
Returns code of the last error
lastInsertId (line 108)

Return last insert ID

  • access: public
integer lastInsertId (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::lastInsertId()
Return last insert ID
listTables (line 142)

Return array of tables that exists in database. This function will return NULL if there are no tables in database

  • access: public
array listTables (void 0)
  • void 0

Redefinition of:
AbstractDBAdapter::listTables()
Return array of tables that exists in database
numRows (line 298)

Return number of rows in specific query result

  • access: public
integer numRows (resource $resource)
  • resource $resource

Redefinition of:
AbstractDBAdapter::numRows()
Return number of rows in specific query result

Inherited Methods

Inherited From AbstractDBAdapter

AbstractDBAdapter::__construct()
AbstractDBAdapter::affectedRows()
AbstractDBAdapter::beginWork()
AbstractDBAdapter::clearDatabase()
AbstractDBAdapter::commit()
AbstractDBAdapter::connect()
AbstractDBAdapter::dropTables()
AbstractDBAdapter::emptyDatabase()
AbstractDBAdapter::emptyTables()
AbstractDBAdapter::escapeField()
AbstractDBAdapter::escapeValue()
AbstractDBAdapter::execute()
AbstractDBAdapter::executeAll()
AbstractDBAdapter::executeOne()
AbstractDBAdapter::executeQuery()
AbstractDBAdapter::exportDatabaseStructure()
AbstractDBAdapter::exportTableStructure()
AbstractDBAdapter::fetchRow()
AbstractDBAdapter::freeResult()
AbstractDBAdapter::getBeginWorkCommand()
AbstractDBAdapter::getCommitCommand()
AbstractDBAdapter::getDatabaseName()
AbstractDBAdapter::getLink()
AbstractDBAdapter::getParams()
AbstractDBAdapter::getRollbackCommand()
AbstractDBAdapter::importDatabaseStructure()
AbstractDBAdapter::isConnected()
AbstractDBAdapter::lastError()
AbstractDBAdapter::lastErrorCode()
AbstractDBAdapter::lastInsertId()
AbstractDBAdapter::listTables()
AbstractDBAdapter::numRows()
AbstractDBAdapter::prepareAndExecute()
AbstractDBAdapter::reconnect()
AbstractDBAdapter::rollback()
AbstractDBAdapter::setDatabaseName()
AbstractDBAdapter::setLink()
AbstractDBAdapter::setParams()

Documentation generated on Wed, 23 Jan 2008 01:58:56 +0000 by phpDocumentor 1.4.0