Construct adpater and connect
-
array
$params: Connection params
Return number of affected rows
integer
affectedRows
(void 0)
Redefined in descendants as:
Start transaction
boolean
beginWork
(void 0)
This function will drop all tables from database this adapter is connected on
boolean
clearDatabase
(void 0)
Commit transaction
boolean
commit
(void 0)
Connect to the database based on the params array
null
connect
(array $params)
Redefined in descendants as:
Drop one or more tables. If $table_names is string only that table will be droped, else script will drop
boolean
dropTables
(mixed $table_names)
-
mixed
$table_names: Array of table names or single table name
Redefined in descendants as:
This function will remove all data from database keeping the structure intact
boolean
emptyDatabase
(void 0)
Remove all data from specific tables
boolean
emptyTables
(mixed $table_names)
-
mixed
$table_names: Single table name or array of table names
Redefined in descendants as:
Escape name of table field or name of the table
string
escapeField
(string $field)
Redefined in descendants as:
Escape value before use it in query. This function makes difference between NULL, scalar and DateTime values
string
escapeValue
(mixed $unescaped)
-
mixed
$unescaped: Value that need to be escaped
Redefined in descendants as:
Execute sql
DBResult
execute
(
string $sql, [
array $arguments =
null])
-
string
$sql
-
array
$arguments
Execute SQL and return all rows. If there is no rows NULL is returned
array
executeAll
(string $sql, [array $arguments = null])
-
string
$sql
-
array
$arguments
Execute query and return first row. If there is no first row NULL is returned
array
executeOne
(string $sql, [array $arguments = null])
-
string
$sql
-
array
$arguments
Basic query execution
mixed
executeQuery
(string $sql)
Redefined in descendants as:
This function will return array of table names and their CREATE TABLE commands
array
exportDatabaseStructure
(void 0)
Redefined in descendants as:
Return CREATE TABLE sql for specific table
string
exportTableStructure
(string $table_name)
Redefined in descendants as:
Fetch row from query result
array
fetchRow
(resource $resource)
Redefined in descendants as:
Free database result
boolean
freeResult
(resource $resource)
Redefined in descendants as:
Get begin work SQL (start transaction)
string
getBeginWorkCommand
(void 0)
Redefined in descendants as:
Get comming SQL
string
getCommitCommand
(void 0)
Redefined in descendants as:
Get database_name
string
getDatabaseName
(null 0)
Return link
resource
getLink
(void 0)
Get params
array
getParams
(null 0)
Get rollback SQL
string
getRollbackCommand
(void 0)
Redefined in descendants as:
This function is able to import database construction from any connected adapter
boolean
importDatabaseStructure
(
AbstractDBAdapter $adapter, [
boolean $clear =
false])
Redefined in descendants as:
Returns true if this adapter is connected to the database
boolean
isConnected
(void 0)
Returns last error message that server thrown
string
lastError
(void 0)
Redefined in descendants as:
Returns code of the last error
integer
lastErrorCode
(void 0)
Redefined in descendants as:
Return last insert ID
integer
lastInsertId
(void 0)
Redefined in descendants as:
Return array of tables that exists in database
array
listTables
(void 0)
Redefined in descendants as:
-
MysqlDBAdapter::listTables()
: Return array of tables that exists in database. This function will return NULL if there are no tables in database
Return number of rows in specific query result
integer
numRows
(resource $resource)
Redefined in descendants as:
Prepare SQL and execute it...
DBResult
prepareAndExecute
(
string $sql, [
$arguments =
null])
Reconnect
null
reconnect
(void 0)
Rollback transaction
boolean
rollback
(void 0)
Set database_name value
null
setDatabaseName
(string $value)
Set connection link
null
setLink
(resource $link)
Set params value
null
setParams
(array $value)