Class JDatabaseDriverMysqli

Description

MySQLi database driver

Located in /libraries/joomla/database/driver/mysqli.php (line 20)

JDatabase
   |
   --JDatabaseDriver
      |
      --JDatabaseDriverMysqli
Direct descendents
Class Description
 class JDatabaseDriverMysql MySQL database driver
 class JDatabaseMysqli MySQLi database driver
Variable Summary
 static string $dbMinimum
 string $name
 string $nameQuote
 string $nullDate
Method Summary
 static boolean isSupported ()
 JDatabaseDriverMysqli __construct (array $options)
 void __destruct ()
 void connect ()
 boolean connected ()
 void disconnect ()
 JDatabaseDriverMysqli dropTable (string $tableName, [boolean $ifExists = true])
 string escape (string $text, [boolean $extra = false])
 mixed execute ()
 mixed fetchArray ([mixed $cursor = null])
 mixed fetchAssoc ([mixed $cursor = null])
 mixed fetchObject ([mixed $cursor = null], [string $class = 'stdClass'])
 void freeResult ([mixed $cursor = null])
 integer getAffectedRows ()
 mixed getCollation ()
 integer getNumRows ([resource $cursor = null])
 array getTableColumns (string $table, [boolean $typeOnly = true])
 array getTableCreate (mixed $tables)
 array getTableKeys (string $table)
 array getTableList ()
 string getVersion ()
 mixed insertid ()
 JDatabaseDriverMysqli lockTable (string $table)
 JDatabaseDriverMysqli renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
 boolean select (string $database)
 boolean setUTF ()
 void transactionCommit ([boolean $toSavepoint = false])
 void transactionRollback ([boolean $toSavepoint = false])
 void transactionStart ([boolean $asSavepoint = false])
Variables
static string $dbMinimum = '5.0.4' (line 54)
  • var: The minimum supported database version.
  • since: 12.2
  • access: protected

Redefinition of:
JDatabaseDriver::$dbMinimum
string $name = 'mysqli' (line 28)

The name of the database driver.

  • since: 12.1
  • access: public

Redefinition of:
JDatabaseDriver::$name
The name of the database driver.

Redefined in descendants as:
string $nameQuote = '`' (line 39)

The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.

  • since: 12.2
  • access: protected

Redefinition of:
JDatabaseDriver::$nameQuote
string $nullDate = '0000-00-00 00:00:00' (line 48)

The null or zero representation of a timestamp for the database driver. This should be defined in child classes to hold the appropriate value for the engine.

  • since: 12.2
  • access: protected

Redefinition of:
JDatabaseDriver::$nullDate

Inherited Variables

Inherited from JDatabaseDriver

JDatabaseDriver::$callStacks
JDatabaseDriver::$connection
JDatabaseDriver::$count
JDatabaseDriver::$cursor
JDatabaseDriver::$debug
JDatabaseDriver::$disconnectHandlers
JDatabaseDriver::$errorMsg
JDatabaseDriver::$errorNum
JDatabaseDriver::$instances
JDatabaseDriver::$limit
JDatabaseDriver::$log
JDatabaseDriver::$offset
JDatabaseDriver::$options
JDatabaseDriver::$sql
JDatabaseDriver::$tablePrefix
JDatabaseDriver::$timings
JDatabaseDriver::$transactionDepth
JDatabaseDriver::$utf
Methods
static isSupported (line 247)

Test to see if the MySQL connector is available.

  • return: True on success, false otherwise.
  • since: 12.1
  • access: public
static boolean isSupported ()

Redefined in descendants as:
Constructor __construct (line 63)

Constructor.

  • since: 12.1
  • access: public
JDatabaseDriverMysqli __construct (array $options)
  • array $options: List of options used to configure the connection

Redefinition of:
JDatabaseDriver::__construct()
Constructor.

Redefined in descendants as:
Destructor __destruct (line 83)

Destructor.

  • since: 12.1
  • access: public
void __destruct ()

Redefined in descendants as:
connect (line 96)

Connects to the database if needed.

  • return: Returns void if the database connected successfully.
  • since: 12.1
  • throws: RuntimeException
  • access: public
void connect ()

Redefinition of:
JDatabaseDriver::connect()
Connects to the database if needed.

Redefined in descendants as:
connected (line 259)

Determines if the connection to the server is active.

  • return: True if connected to the database engine.
  • since: 12.1
  • access: public
boolean connected ()

Redefinition of:
JDatabaseDriver::connected()
Determines if the connection to the server is active.

Redefined in descendants as:
disconnect (line 200)

Disconnects the database.

  • since: 12.1
  • access: public
void disconnect ()

Redefinition of:
JDatabaseDriver::disconnect()
Disconnects the database.

Redefined in descendants as:
dropTable (line 280)

Drops a table from the database.

  • return: Returns this object to support chaining.
  • since: 12.2
  • throws: RuntimeException
  • access: public
JDatabaseDriverMysqli dropTable (string $tableName, [boolean $ifExists = true])
  • string $tableName: The name of the database table to drop.
  • boolean $ifExists: Optionally specify that the table must exist before it is dropped.

Redefinition of:
JDatabaseDriver::dropTable()
Drops a table from the database.
escape (line 226)

Method to escape a string for usage in an SQL statement.

  • return: The escaped string.
  • since: 12.1
  • access: public
string escape (string $text, [boolean $extra = false])
  • string $text: The string to be escaped.
  • boolean $extra: Optional parameter to provide extra escaping.

Redefinition of:
JDatabaseDriver::escape()
Escapes a string for usage in an SQL statement.

Redefined in descendants as:
execute (line 515)

Execute the SQL statement.

  • return: A database cursor resource on success, boolean false on failure.
  • since: 12.1
  • throws: RuntimeException
  • access: public
mixed execute ()

Redefinition of:
JDatabaseDriver::execute()
Execute the SQL statement.

Redefined in descendants as:
fetchArray (line 775)

Method to fetch a row from the result set cursor as an array.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 12.1
  • access: protected
mixed fetchArray ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefinition of:
JDatabaseDriver::fetchArray()
Method to fetch a row from the result set cursor as an array.

Redefined in descendants as:
fetchAssoc (line 789)

Method to fetch a row from the result set cursor as an associative array.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 12.1
  • access: protected
mixed fetchAssoc ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefinition of:
JDatabaseDriver::fetchAssoc()
Method to fetch a row from the result set cursor as an associative array.

Redefined in descendants as:
fetchObject (line 804)

Method to fetch a row from the result set cursor as an object.

  • return: Either the next row from the result set or false if there are no more rows.
  • since: 12.1
  • access: protected
mixed fetchObject ([mixed $cursor = null], [string $class = 'stdClass'])
  • mixed $cursor: The optional result set cursor from which to fetch the row.
  • string $class: The class name to use for the returned row object.

Redefinition of:
JDatabaseDriver::fetchObject()
Method to fetch a row from the result set cursor as an object.

Redefined in descendants as:
freeResult (line 818)

Method to free up the memory used for the result set.

  • since: 12.1
  • access: protected
void freeResult ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

Redefinition of:
JDatabaseDriver::freeResult()
Method to free up the memory used for the result set.

Redefined in descendants as:
getAffectedRows (line 300)

Get the number of affected rows for the previous executed SQL statement.

  • return: The number of affected rows.
  • since: 12.1
  • access: public
integer getAffectedRows ()

Redefinition of:
JDatabaseDriver::getAffectedRows()
Get the number of affected rows for the previous executed SQL statement.

Redefined in descendants as:
getCollation (line 315)

Method to get the database collation in use by sampling a text field of a table in the database.

  • return: The collation in use by the database (string) or boolean false if not supported.
  • since: 12.2
  • throws: RuntimeException
  • access: public
mixed getCollation ()

Redefinition of:
JDatabaseDriver::getCollation()
Method to get the database collation in use by sampling a text field of a table in the database.
getNumRows (line 344)

Get the number of returned rows for the previous executed SQL statement.

  • return: The number of returned rows.
  • since: 12.1
  • access: public
integer getNumRows ([resource $cursor = null])
  • resource $cursor: An optional database cursor resource to extract the row count from.

Redefinition of:
JDatabaseDriver::getNumRows()
Get the number of returned rows for the previous executed SQL statement.

Redefined in descendants as:
getTableColumns (line 391)

Retrieves field information about a given table.

  • return: An array of fields for the database table.
  • since: 12.2
  • throws: RuntimeException
  • access: public
array getTableColumns (string $table, [boolean $typeOnly = true])
  • string $table: The name of the database table.
  • boolean $typeOnly: True to only return field types.

Redefinition of:
JDatabaseDriver::getTableColumns()
Retrieves field information about the given tables.
getTableCreate (line 359)

Shows the table CREATE statement that creates the given tables.

  • return: A list of the create SQL for the tables.
  • since: 12.1
  • throws: RuntimeException
  • access: public
array getTableCreate (mixed $tables)
  • mixed $tables: A table name or a list of table names.

Redefinition of:
JDatabaseDriver::getTableCreate()
Shows the table CREATE statement that creates the given tables.
getTableKeys (line 431)

Get the details list of keys for a table.

  • return: An array of the column specification for the table.
  • since: 12.2
  • throws: RuntimeException
  • access: public
array getTableKeys (string $table)
  • string $table: The name of the table.

Redefinition of:
JDatabaseDriver::getTableKeys()
Retrieves field information about the given tables.
getTableList (line 450)

Method to get an array of all tables in the database.

  • return: An array of all the tables in the database.
  • since: 12.2
  • throws: RuntimeException
  • access: public
array getTableList ()

Redefinition of:
JDatabaseDriver::getTableList()
Method to get an array of all tables in the database.
getVersion (line 468)

Get the version of the database connector.

  • return: The database connector version.
  • since: 12.1
  • access: public
string getVersion ()

Redefinition of:
JDatabaseDriver::getVersion()
Get the version of the database connector

Redefined in descendants as:
insertid (line 483)

Method to get the auto-incremented value from the last INSERT statement.

  • return: The value of the auto-increment field from the last inserted row. If the value is greater than maximal int value, it will return a string.
  • since: 12.1
  • access: public
mixed insertid ()

Redefinition of:
JDatabaseDriver::insertid()
Method to get the auto-incremented value from the last INSERT statement.

Redefined in descendants as:
lockTable (line 500)

Locks a table in the database.

  • return: Returns this object to support chaining.
  • since: 12.2
  • throws: RuntimeException
  • access: public
JDatabaseDriverMysqli lockTable (string $table)
  • string $table: The name of the table to unlock.

Redefinition of:
JDatabaseDriver::lockTable()
Locks a table in the database.
renameTable (line 625)

Renames a table in the database.

  • return: Returns this object to support chaining.
  • since: 12.2
  • throws: RuntimeException
  • access: public
JDatabaseDriverMysqli renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
  • string $oldTable: The name of the table to be renamed
  • string $newTable: The new name for the table.
  • string $backup: Not used by MySQL.
  • string $prefix: Not used by MySQL.

Redefinition of:
JDatabaseDriver::renameTable()
Renames a table in the database.
select (line 642)

Select a database for use.

  • return: True if the database was successfully selected.
  • since: 12.1
  • throws: RuntimeException
  • access: public
boolean select (string $database)
  • string $database: The name of the database to select for use.

Redefinition of:
JDatabaseDriver::select()
Select a database for use.

Redefined in descendants as:
setUTF (line 666)

Set the connection to use UTF-8 character encoding.

  • return: True on success.
  • since: 12.1
  • access: public
boolean setUTF ()

Redefinition of:
JDatabaseDriver::setUTF()
Set the connection to use UTF-8 character encoding.

Redefined in descendants as:
transactionCommit (line 683)

Method to commit a transaction.

  • since: 12.2
  • throws: RuntimeException
  • access: public
void transactionCommit ([boolean $toSavepoint = false])
  • boolean $toSavepoint: If true, commit to the last savepoint.

Redefinition of:
JDatabaseDriver::transactionCommit()
Method to commit a transaction.
transactionRollback (line 710)

Method to roll back a transaction.

  • since: 12.2
  • throws: RuntimeException
  • access: public
void transactionRollback ([boolean $toSavepoint = false])
  • boolean $toSavepoint: If true, rollback to the last savepoint.

Redefinition of:
JDatabaseDriver::transactionRollback()
Method to roll back a transaction.
transactionStart (line 743)

Method to initialize a transaction.

  • since: 12.2
  • throws: RuntimeException
  • access: public
void transactionStart ([boolean $asSavepoint = false])
  • boolean $asSavepoint: If true and a transaction is already active, a savepoint will be created.

Redefinition of:
JDatabaseDriver::transactionStart()
Method to initialize a transaction.
unlockTables (line 835)

Unlocks tables in the database.

  • return: Returns this object to support chaining.
  • since: 12.1
  • throws: RuntimeException
  • access: public
JDatabaseDriverMysqli unlockTables ()

Redefinition of:
JDatabaseDriver::unlockTables()
Unlocks tables in the database.

Inherited Methods

Inherited From JDatabaseDriver

 JDatabaseDriver::__construct()
 JDatabaseDriver::addDisconnectHandler()
 JDatabaseDriver::alterDbCharacterSet()
 JDatabaseDriver::connect()
 JDatabaseDriver::connected()
 JDatabaseDriver::createDatabase()
 JDatabaseDriver::disconnect()
 JDatabaseDriver::dropTable()
 JDatabaseDriver::escape()
 JDatabaseDriver::execute()
 JDatabaseDriver::fetchArray()
 JDatabaseDriver::fetchAssoc()
 JDatabaseDriver::fetchObject()
 JDatabaseDriver::freeResult()
 JDatabaseDriver::getAffectedRows()
 JDatabaseDriver::getAlterDbCharacterSet()
 JDatabaseDriver::getCallStacks()
 JDatabaseDriver::getCollation()
 JDatabaseDriver::getConnection()
 JDatabaseDriver::getConnectors()
 JDatabaseDriver::getCount()
 JDatabaseDriver::getCreateDatabaseQuery()
 JDatabaseDriver::getDatabase()
 JDatabaseDriver::getDateFormat()
 JDatabaseDriver::getExporter()
 JDatabaseDriver::getImporter()
 JDatabaseDriver::getInstance()
 JDatabaseDriver::getIterator()
 JDatabaseDriver::getLog()
 JDatabaseDriver::getMinimum()
 JDatabaseDriver::getNullDate()
 JDatabaseDriver::getNumRows()
 JDatabaseDriver::getPrefix()
 JDatabaseDriver::getQuery()
 JDatabaseDriver::getTableColumns()
 JDatabaseDriver::getTableCreate()
 JDatabaseDriver::getTableKeys()
 JDatabaseDriver::getTableList()
 JDatabaseDriver::getTimings()
 JDatabaseDriver::getUTFSupport()
 JDatabaseDriver::getVersion()
 JDatabaseDriver::hasUTFSupport()
 JDatabaseDriver::insertid()
 JDatabaseDriver::insertObject()
 JDatabaseDriver::isMinimumVersion()
 JDatabaseDriver::loadAssoc()
 JDatabaseDriver::loadAssocList()
 JDatabaseDriver::loadColumn()
 JDatabaseDriver::loadNextObject()
 JDatabaseDriver::loadNextRow()
 JDatabaseDriver::loadObject()
 JDatabaseDriver::loadObjectList()
 JDatabaseDriver::loadResult()
 JDatabaseDriver::loadRow()
 JDatabaseDriver::loadRowList()
 JDatabaseDriver::lockTable()
 JDatabaseDriver::quote()
 JDatabaseDriver::quoteName()
 JDatabaseDriver::quoteNameStr()
 JDatabaseDriver::renameTable()
 JDatabaseDriver::replacePrefix()
 JDatabaseDriver::select()
 JDatabaseDriver::setDebug()
 JDatabaseDriver::setQuery()
 JDatabaseDriver::setUTF()
 JDatabaseDriver::splitSql()
 JDatabaseDriver::transactionCommit()
 JDatabaseDriver::transactionRollback()
 JDatabaseDriver::transactionStart()
 JDatabaseDriver::truncateTable()
 JDatabaseDriver::unlockTables()
 JDatabaseDriver::updateObject()
 JDatabaseDriver::__call()

Inherited From JDatabase

 JDatabase::getConnectors()
 JDatabase::getErrorMsg()
 JDatabase::getErrorNum()
 JDatabase::getInstance()
 JDatabase::query()
 JDatabase::splitSql()
 JDatabase::stderr()
 JDatabase::test()

Documentation generated on Tue, 19 Nov 2013 15:09:16 +0100 by phpDocumentor 1.4.3