- Class name: DbPDOCore
- Parent class: Db
- Source: classes/db/DbPDO.php line 30
- $_servers
- $database
- $instance
- $is_cache_enabled
- $last_cached
- $last_query
- $link
- $password
- $result
- $server
- $user
- Affected_Rows
- Insert_ID
- __construct
- __destruct
- _escape
- _getPDO
- _numRows
- _query
- autoExecute
- autoExecuteWithNullValues
- checkConnection
- checkCreatePrivilege
- checkEncoding
- connect
- createDatabase
- delete
- disconnect
- displayError
- ds
- escape
- execute
- executeS
- getBestEngine
- getClass
- getInstance
- getMsgError
- getNumberError
- getRow
- getValue
- getVersion
- hasTableWithSamePrefix
- insert
- loadSlaveServers
- nextRow
- numRows
- ps
- q
- query
- s
- set_db
- tryToConnect
- tryUTF8
- update
protected array $_servers = array()
- Visibility: protected
- This property is static.
- This property is defined by DbCore.
- Source: classes/db/Db.php line 82.
protected string $database
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 57.
protected array $instance = array()
- Visibility: protected
- This property is static.
- This property is defined by DbCore.
- Source: classes/db/Db.php line 77.
protected boolean $is_cache_enabled
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 62.
protected string $last_cached
Last cached query
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 96.
protected string $last_query
Store last executed query
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 89.
protected mixed $link
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 67.
protected string $password
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 52.
protected mixed $result
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 72.
protected string $server
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 42.
protected string $user
- Visibility: protected
- This property is defined by DbCore.
- Source: classes/db/Db.php line 47.
mixed DbPDOCore::Affected_Rows()
- Visibility: public
- Source: classes/db/DbPDO.php line 125
mixed DbPDOCore::Insert_ID()
- Visibility: public
- Source: classes/db/DbPDO.php line 117
mixed DbCore::__construct(string $server, string $user, string $password, string $database, boolean $connect)
Instantiate database connection
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 248
- $server string - Server address
- $user string - User login
- $password string - User password
- $database string - Database name
- $connect boolean - If false, don't connect in constructor (since 1.5.0)
mixed DbCore::__destruct()
Close connection to database
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 266
mixed DbPDOCore::_escape($str)
- Visibility: public
- Source: classes/db/DbPDO.php line 159
- $str mixed
mixed DbPDOCore::_getPDO($host, $user, $password, $dbname, $timeout)
- Visibility: protected
- This method is static.
- Source: classes/db/DbPDO.php line 32
- $host mixed
- $user mixed
- $password mixed
- $dbname mixed
- $timeout mixed
mixed DbPDOCore::_numRows($result)
- Visibility: protected
- Source: classes/db/DbPDO.php line 109
- $result mixed
mixed DbPDOCore::_query($sql)
- Visibility: protected
- Source: classes/db/DbPDO.php line 89
- $sql mixed
mixed DbCore::autoExecute($table, $data, $type, $where, $limit, $use_cache, $use_null)
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 275
- $table mixed
- $data mixed
- $type mixed
- $where mixed
- $limit mixed
- $use_cache mixed
- $use_null mixed
mixed|boolean DbCore::autoExecuteWithNullValues(string $table, string $values, string $type, string $where, integer $limit)
Filter SQL query within a blacklist
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 307
- $table string - Table where insert/update data
- $values string - Data to insert/update
- $type string - INSERT or UPDATE
- $where string - WHERE clause, only for UPDATE (optional)
- $limit integer - LIMIT clause (optional)
integer DbCore::checkConnection(string $server, string $user, string $pwd, string $db, boolean $new_db_link, boolean $engine, $timeout)
Try a connection to te database
- Visibility: public
- This method is static.
- This method is defined by DbCore.
- Source: classes/db/Db.php line 672
- $server string - Server address
- $user string - Login for database connection
- $pwd string - Password for database connection
- $db string - Database name
- $new_db_link boolean
- $engine boolean
- $timeout mixed
mixed DbPDOCore::checkCreatePrivilege($server, $user, $pwd, $db, $prefix, $engine)
- Visibility: public
- This method is static.
- Source: classes/db/DbPDO.php line 190
- $server mixed
- $user mixed
- $pwd mixed
- $db mixed
- $prefix mixed
- $engine mixed
integer DbCore::checkEncoding(string $server, string $user, string $pwd)
Try a connection to te database
- Visibility: public
- This method is static.
- This method is defined by DbCore.
- Source: classes/db/Db.php line 685
- $server string - Server address
- $user string - Login for database connection
- $pwd string - Password for database connection
mixed DbPDOCore::connect()
- Visibility: public
- Source: classes/db/DbPDO.php line 63
mixed DbPDOCore::createDatabase($host, $user, $password, $dbname, $dropit)
- Visibility: public
- This method is static.
- Source: classes/db/DbPDO.php line 47
- $host mixed
- $user mixed
- $password mixed
- $dbname mixed
- $dropit mixed
boolean DbCore::delete(string $table, string $where, integer $limit, boolean $use_cache, boolean $add_prefix)
Execute a DELETE query
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 440
- $table string - Name of the table to delete
- $where string - WHERE clause on query
- $limit integer - Number max of rows to delete
- $use_cache boolean - Use cache or not
- $add_prefix boolean - Add or not DB_PREFIX before table name
mixed DbPDOCore::disconnect()
- Visibility: public
- Source: classes/db/DbPDO.php line 81
mixed DbCore::displayError(boolean $sql)
Display last SQL error
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 622
- $sql boolean
mixed DbCore::ds($sql, $use_cache)
- Visibility: public
- This method is static.
- This method is defined by DbCore.
- Source: classes/db/Db.php line 733
- $sql mixed
- $use_cache mixed
string DbCore::escape(string $string, boolean $html_ok)
Sanitize data which will be injected into SQL query
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 647
- $string string - SQL data which will be injected into SQL query
- $html_ok boolean - Does data contain HTML code ? (optional)
boolean DbCore::execute(string $sql, boolean $use_cache)
Execute a query
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 460
- $sql string
- $use_cache boolean
array DbCore::executeS(string $sql, boolean $array, boolean $use_cache)
ExecuteS return the result of $sql as array
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 479
- $sql string - query to execute
- $array boolean - return an array instead of a mysql_result object (deprecated since 1.5.0, use query method instead)
- $use_cache boolean - if query has been already executed, use its result
mixed DbPDOCore::getBestEngine()
- Visibility: public
- Source: classes/db/DbPDO.php line 226
string DbCore::getClass()
Get child layer class
- Visibility: public
- This method is static.
- This method is defined by DbCore.
- Source: classes/db/Db.php line 229
\Db DbCore::getInstance(boolean $master)
Get Db object instance
- Visibility: public
- This method is static.
- This method is defined by DbCore.
- Source: classes/db/Db.php line 176
- $master boolean - Decides whether the connection to be returned by the master server or the slave server
mixed DbPDOCore::getMsgError($query)
- Visibility: public
- Source: classes/db/DbPDO.php line 133
- $query mixed
mixed DbPDOCore::getNumberError()
- Visibility: public
- Source: classes/db/DbPDO.php line 142
array DbCore::getRow(mixed $sql, boolean $use_cache)
getRow return an associative array containing the first row of the query This function automatically add "limit 1" to the query
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 534
- $sql mixed - the select query (without "LIMIT 1")
- $use_cache boolean - find it in cache first
mixed DbCore::getValue(mixed $sql, boolean $use_cache)
getValue return the first item of a select query.
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 567
- $sql mixed
- $use_cache boolean
mixed DbPDOCore::getVersion()
- Visibility: public
- Source: classes/db/DbPDO.php line 151
mixed DbPDOCore::hasTableWithSamePrefix($server, $user, $pwd, $db, $prefix)
- Visibility: public
- This method is static.
- Source: classes/db/DbPDO.php line 177
- $server mixed
- $user mixed
- $pwd mixed
- $db mixed
- $prefix mixed
boolean DbCore::insert(string $table, array $data, boolean $null_values, boolean $use_cache, integer $type, boolean $add_prefix)
Execute an INSERT query
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 340
- $table string - Table name without prefix
- $data array - Data to insert as associative array. If $data is a list of arrays, multiple insert will be done
- $null_values boolean - If we want to use NULL values instead of empty quotes
- $use_cache boolean
- $type integer - Must be Db::INSERT or Db::INSERT_IGNORE or Db::REPLACE
- $add_prefix boolean - Add or not DB_PREFIX before table name
mixed DbCore::loadSlaveServers()
- Visibility: protected
- This method is static.
- This method is defined by DbCore.
- Source: classes/db/Db.php line 211
mixed DbPDOCore::nextRow($result)
- Visibility: public
- Source: classes/db/DbPDO.php line 97
- $result mixed
integer DbCore::numRows()
Get number of rows for last result
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 582
mixed DbCore::ps($sql, $use_cache)
- Visibility: public
- This method is static.
- This method is defined by DbCore.
- Source: classes/db/Db.php line 722
- $sql mixed
- $use_cache mixed
mixed DbCore::q(string $sql, boolean $use_cache)
Execute a query
- Visibility: protected
- This method is defined by DbCore.
- Source: classes/db/Db.php line 603
- $sql string
- $use_cache boolean
mixed DbCore::query(string $sql)
Execute a query and get result ressource
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 318
- $sql string
mixed DbCore::s($sql, $use_cache)
- Visibility: public
- This method is static.
- This method is defined by DbCore.
- Source: classes/db/Db.php line 713
- $sql mixed
- $use_cache mixed
mixed DbPDOCore::set_db($db_name)
- Visibility: public
- Source: classes/db/DbPDO.php line 169
- $db_name mixed
mixed DbPDOCore::tryToConnect($server, $user, $pwd, $db, $newDbLink, $engine, $timeout)
- Visibility: public
- This method is static.
- Source: classes/db/DbPDO.php line 215
- $server mixed
- $user mixed
- $pwd mixed
- $db mixed
- $newDbLink mixed
- $engine mixed
- $timeout mixed
mixed DbPDOCore::tryUTF8($server, $user, $pwd)
- Visibility: public
- This method is static.
- Source: classes/db/DbPDO.php line 254
- $server mixed
- $user mixed
- $pwd mixed
boolean DbCore::update(string $table, array $data, string $where, integer $limit, boolean $null_values, boolean $use_cache, boolean $add_prefix)
- Visibility: public
- This method is defined by DbCore.
- Source: classes/db/Db.php line 403
- $table string - Table name without prefix
- $data array - Data to insert as associative array. If $data is a list of arrays, multiple insert will be done
- $where string - WHERE condition
- $limit integer
- $null_values boolean - If we want to use NULL values instead of empty quotes
- $use_cache boolean
- $add_prefix boolean - Add or not DB_PREFIX before table name