|
| | setTimezone ($sTimezone) |
| |
| | getLink () |
| |
| | res ($sQuery, $aBindings=[], $bReplaying=false) |
| |
| | getAll ($sQuery, $aBindings=[], $iFetchType=PDO::FETCH_ASSOC) |
| |
| | getRow ($sQuery, $aBindings=[], $iFetchStyle=PDO::FETCH_ASSOC) |
| |
| | getColumn ($sQuery, $aBindings=[]) |
| |
| | getOne ($sQuery, $aBindings=[], $iIndex=0) |
| |
| | getFirstRow ($sQuery, $aBindings=[], $iFetchStyle=PDO::FETCH_ASSOC) |
| |
| | getNextRow () |
| |
| | getAllWithKey ($sQuery, $sFieldKey, $aBindings=[], $iFetchType=PDO::FETCH_ASSOC) |
| |
| | getPairs ($sQuery, $sFieldKey, $sFieldValue, $aBindings=[]) |
| |
| | query ($sQuery, $aBindings=[]) |
| |
| | getNumRows ($oStmt=null) |
| |
| | getAffectedRows ($oStmt=null) |
| |
| | fillArray ($oStmt, $iFetchType=PDO::FETCH_ASSOC) |
| |
| | lastId () |
| |
| | getParam ($sName, $bCache=true) |
| |
| | setParam ($sName, $sValue) |
| |
| | listTables () |
| |
| | getFields ($sTable) |
| |
| | isFieldExists ($sTable, $sFieldName) |
| |
| | fetchField ($mixedQuery, $iField, $aBindings=[]) |
| |
| | getDbCacheObject () |
| |
| | genDbCacheKey ($sName) |
| |
| | fromCache ($sName, $sFunc) |
| |
| | cleanCache ($sName) |
| |
| & | fromMemory ($sName, $sFunc) |
| |
| | cleanMemory ($sName) |
| |
| | arrayToSQL ($a, $sDiv=',') |
| |
| | escape ($sText, $bReal=true) |
| |
| | implode_escape ($mixed) |
| |
| | unescape ($mixed) |
| |
Definition at line 12 of file ChWsbDb.php.
◆ __construct()
◆ arrayToSQL()
| ChWsbDb::arrayToSQL |
( |
|
$a, |
|
|
|
$sDiv = ',' |
|
) |
| |
Convert array of key => values to SQL query. Array keys are field names and array values are field values.
- Parameters
-
| $a | array |
| $sDiv | fields separator, by default it is ',', another useful value is ' AND ' |
- Returns
- part of SQL query string
Definition at line 609 of file ChWsbDb.php.
◆ cleanCache()
| ChWsbDb::cleanCache |
( |
|
$sName | ) |
|
◆ cleanMemory()
| ChWsbDb::cleanMemory |
( |
|
$sName | ) |
|
◆ connect()
connect to database with appointed parameters
Definition at line 94 of file ChWsbDb.php.
◆ disconnect()
◆ escape()
| ChWsbDb::escape |
( |
|
$sText, |
|
|
|
$bReal = true |
|
) |
| |
- Parameters
-
| string | $sText | |
| bool | $bReal | return the actual quotes value or strip the quotes, PS: Use the pdo bindings for user's sake |
- Returns
- string
Definition at line 624 of file ChWsbDb.php.
◆ fetchField()
| ChWsbDb::fetchField |
( |
|
$mixedQuery, |
|
|
|
$iField, |
|
|
|
$aBindings = [] |
|
) |
| |
◆ fillArray()
| ChWsbDb::fillArray |
( |
|
$oStmt, |
|
|
|
$iFetchType = PDO::FETCH_ASSOC |
|
) |
| |
- Parameters
-
| PDOStatement | $oStmt | |
| int | $iFetchType | |
- Returns
- array
Definition at line 430 of file ChWsbDb.php.
◆ fromCache()
| ChWsbDb::fromCache |
( |
|
$sName, |
|
|
|
$sFunc |
|
) |
| |
◆ fromMemory()
| & ChWsbDb::fromMemory |
( |
|
$sName, |
|
|
|
$sFunc |
|
) |
| |
◆ genDbCacheKey()
| ChWsbDb::genDbCacheKey |
( |
|
$sName | ) |
|
◆ getAffectedRows()
| ChWsbDb::getAffectedRows |
( |
|
$oStmt = null | ) |
|
execute any query return number of rows affected/false
- Parameters
-
| null | PDOStatement | $oStmt | |
- Returns
- int
Definition at line 409 of file ChWsbDb.php.
◆ getAll()
| ChWsbDb::getAll |
( |
|
$sQuery, |
|
|
|
$aBindings = [], |
|
|
|
$iFetchType = PDO::FETCH_ASSOC |
|
) |
| |
execute sql query and return table of records as result
- Parameters
-
| string | $sQuery | |
| array | $aBindings | |
| int | $iFetchType | |
- Returns
- array
Definition at line 206 of file ChWsbDb.php.
◆ getAllWithKey()
| ChWsbDb::getAllWithKey |
( |
|
$sQuery, |
|
|
|
$sFieldKey, |
|
|
|
$aBindings = [], |
|
|
|
$iFetchType = PDO::FETCH_ASSOC |
|
) |
| |
execute sql query and return table of records as result
- Parameters
-
| string | $sQuery | |
| string | $sFieldKey | |
| array | $aBindings | |
| int | $iFetchType | |
- Returns
- array
Definition at line 338 of file ChWsbDb.php.
◆ getColumn()
| ChWsbDb::getColumn |
( |
|
$sQuery, |
|
|
|
$aBindings = [] |
|
) |
| |
execute sql query and return a column as result
- Parameters
-
| string | $sQuery | |
| array | $aBindings | |
- Returns
- array
Definition at line 243 of file ChWsbDb.php.
◆ getDbCacheObject()
| ChWsbDb::getDbCacheObject |
( |
| ) |
|
◆ getFields()
| ChWsbDb::getFields |
( |
|
$sTable | ) |
|
◆ getFirstRow()
| ChWsbDb::getFirstRow |
( |
|
$sQuery, |
|
|
|
$aBindings = [], |
|
|
|
$iFetchStyle = PDO::FETCH_ASSOC |
|
) |
| |
execute sql query and return the first row of result and keep $array type and poiter to all data
- Parameters
-
| string | $sQuery | |
| array | $aBindings | |
| int | $iFetchStyle | |
- Returns
- array
Definition at line 284 of file ChWsbDb.php.
◆ getInstance()
| static ChWsbDb::getInstance |
( |
| ) |
|
|
static |
Instance of db class
- Returns
- static
Definition at line 82 of file ChWsbDb.php.
◆ getLink()
◆ getNextRow()
return next row of pointed last getFirstRow calling data
- Returns
- array
Definition at line 309 of file ChWsbDb.php.
◆ getNumRows()
| ChWsbDb::getNumRows |
( |
|
$oStmt = null | ) |
|
- Parameters
-
| null | PDOStatement | $oStmt | |
- Returns
- int
Definition at line 398 of file ChWsbDb.php.
◆ getOne()
| ChWsbDb::getOne |
( |
|
$sQuery, |
|
|
|
$aBindings = [], |
|
|
|
$iIndex = 0 |
|
) |
| |
execute sql query and return one value result
- Parameters
-
| string | $sQuery | |
| array | $aBindings | |
| int | $iIndex | |
- Returns
- mixed
Definition at line 263 of file ChWsbDb.php.
◆ getPairs()
| ChWsbDb::getPairs |
( |
|
$sQuery, |
|
|
|
$sFieldKey, |
|
|
|
$sFieldValue, |
|
|
|
$aBindings = [] |
|
) |
| |
execute sql query and return table of records as result
- Parameters
-
| string | $sQuery | |
| string | $sFieldKey | |
| string | $sFieldValue | |
| array | $aBindings | |
- Returns
- array
Definition at line 363 of file ChWsbDb.php.
◆ getParam()
| ChWsbDb::getParam |
( |
|
$sName, |
|
|
|
$bCache = true |
|
) |
| |
◆ getRow()
| ChWsbDb::getRow |
( |
|
$sQuery, |
|
|
|
$aBindings = [], |
|
|
|
$iFetchStyle = PDO::FETCH_ASSOC |
|
) |
| |
execute sql query and return one row result
- Parameters
-
| string | $sQuery | |
| array | $aBindings | |
| int | $iFetchStyle | |
- Returns
- array
Definition at line 225 of file ChWsbDb.php.
◆ implode_escape()
| ChWsbDb::implode_escape |
( |
|
$mixed | ) |
|
This function is usefull when you need to form array of parameters to pass to IN(...) SQL construction. Example:
$a = array(2, 4.5, 'apple', 'car');
$s =
"SELECT * FROM `t` WHERE `a` IN (" .
$oDb->implode_escape($a) .
")";
- Parameters
-
| $mixed | array or parameters or just one paramter |
- Returns
- string which is ready to pass to IN(...) SQL construction
Definition at line 650 of file ChWsbDb.php.
◆ isFieldExists()
| ChWsbDb::isFieldExists |
( |
|
$sTable, |
|
|
|
$sFieldName |
|
) |
| |
◆ lastId()
Retuns last insert id
- Returns
- string
Definition at line 449 of file ChWsbDb.php.
◆ listTables()
Returns an array of all the table names in the database
- Returns
- array
Definition at line 471 of file ChWsbDb.php.
◆ query()
| ChWsbDb::query |
( |
|
$sQuery, |
|
|
|
$aBindings = [] |
|
) |
| |
execute any query return number of rows affected
- Parameters
-
| string | $sQuery | |
| array | $aBindings | |
- Returns
- int
Definition at line 386 of file ChWsbDb.php.
◆ res()
| ChWsbDb::res |
( |
|
$sQuery, |
|
|
|
$aBindings = [], |
|
|
|
$bReplaying = false |
|
) |
| |
execute any query
- Parameters
-
| string | $sQuery | |
| array | $aBindings | |
| bool | $bReplaying | |
- Returns
- PDOStatement
Definition at line 150 of file ChWsbDb.php.
◆ setParam()
| ChWsbDb::setParam |
( |
|
$sName, |
|
|
|
$sValue |
|
) |
| |
◆ setTimezone()
| ChWsbDb::setTimezone |
( |
|
$sTimezone | ) |
|
Sets mysql time zone for current session
- Parameters
-
Definition at line 130 of file ChWsbDb.php.
◆ unescape()
| ChWsbDb::unescape |
( |
|
$mixed | ) |
|
- Parameters
-
- Returns
- array|mixed
Definition at line 670 of file ChWsbDb.php.
◆ $dbname
◆ $host
◆ $iCurrentFetchStyle
| ChWsbDb::$iCurrentFetchStyle |
|
protected |
◆ $instance
◆ $link
◆ $oCurrentStmt
◆ $oDbCacheObject
| ChWsbDb::$oDbCacheObject = null |
◆ $oParams
◆ $password
◆ $port
◆ $socket
◆ $user
The documentation for this class was generated from the following file: