Class JDatabaseMySQL

Description

MySQL database driver

Located in /libraries/joomla/database/database/mysql.php (line 24)

JDatabase
   |
   --JDatabaseMySQL
Direct descendents
Class Description
JDatabaseMySQLi MySQLi database driver
Variable Summary
string $dbMinimum
string $name
string $nameQuote
string $nullDate
Method Summary
static boolean test ()
JDatabaseMySQL __construct (array $options)
void __destruct ()
boolean connected ()
JDatabaseMySQL dropTable (string $tableName, [boolean $ifExists = true])
string escape (string $text, [boolean $extra = false])
mixed execute ()
string explain ()
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])
mixed getQuery ([boolean $new = false])
array getTableColumns (string $table, [boolean $typeOnly = true])
array getTableCreate (mixed $tables)
array getTableKeys (string $table)
array getTableList ()
string getVersion ()
boolean hasUTF ()
integer insertid ()
JDatabaseMySQL lockTable (string $table)
mixed queryBatch ([boolean $abortOnError = true], [boolean $transactionSafe = false])
JDatabase renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
boolean select (string $database)
boolean setUTF ()
Variables
string $dbMinimum = '5.0.4' (line 58)
  • var: The minimum supported database version.
  • since: 12.1
  • access: protected

Redefinition of:
JDatabase::$dbMinimum
string $name = 'mysql' (line 32)

The name of the database driver.

  • since: 11.1
  • access: public

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

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

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: 11.1
  • access: protected

Redefinition of:
JDatabase::$nameQuote
string $nullDate = '0000-00-00 00:00:00' (line 52)

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: 11.1
  • access: protected

Redefinition of:
JDatabase::$nullDate

Inherited Variables

Inherited from JDatabase

JDatabase::$connection
JDatabase::$count
JDatabase::$cursor
JDatabase::$debug
JDatabase::$errorMsg
JDatabase::$errorNum
JDatabase::$hasQuoted
JDatabase::$instances
JDatabase::$limit
JDatabase::$log
JDatabase::$offset
JDatabase::$quoted
JDatabase::$sql
JDatabase::$tablePrefix
JDatabase::$utf
JDatabase::$_database
Methods
static method test (line 167)

Test to see if the MySQL connector is available.

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

Redefined in descendants as:
Constructor __construct (line 67)

Constructor.

  • since: 11.1
  • access: protected
JDatabaseMySQL __construct (array $options)
  • array $options: Array of database options with keys: host, user, password, database, select.

Redefinition of:
JDatabase::__construct()
Constructor.

Redefined in descendants as:
Destructor __destruct (line 130)

Destructor.

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

Redefined in descendants as:
connected (line 179)

Determines if the connection to the server is active.

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

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

Redefined in descendants as:
dropTable (line 200)

Drops a table from the database.

  • return: Returns this object to support chaining.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
JDatabaseMySQL 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:
JDatabase::dropTable()
Drops a table from the database.
escape (line 148)

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

  • return: The escaped string.
  • since: 11.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:
JDatabase::escape()
Method to escape a string for usage in an SQL statement.

Redefined in descendants as:
execute (line 491)

Execute the SQL statement.

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

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

Redefined in descendants as:
explain (line 737)

Diagnostic method to return explain information for a query.

  • return: The explain output.
  • deprecated: 12.1
  • since: 11.1
  • access: public
string explain ()

Redefinition of:
JDatabase::explain()
Diagnostic method to return explain information for a query.
fetchArray (line 681)

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: 11.1
  • access: protected
mixed fetchArray ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

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

Redefined in descendants as:
fetchAssoc (line 695)

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: 11.1
  • access: protected
mixed fetchAssoc ([mixed $cursor = null])
  • mixed $cursor: The optional result set cursor from which to fetch the row.

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

Redefined in descendants as:
fetchObject (line 710)

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: 11.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:
JDatabase::fetchObject()
Method to fetch a row from the result set cursor as an object.

Redefined in descendants as:
freeResult (line 724)

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

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

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

Redefined in descendants as:
getAffectedRows (line 218)

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

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

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

Redefined in descendants as:
getCollation (line 231)

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: 11.1
  • throws: JDatabaseException
  • access: public
mixed getCollation ()

Redefinition of:
JDatabase::getCollation()
Method to get the database collation in use by sampling a text field of a table in the database.
getExporter (line 246)

Gets an exporter class object.

  • return: An exporter object.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
JDatabaseExporterMySQL getExporter ()

Redefined in descendants as:
getImporter (line 268)

Gets an importer class object.

  • return: An importer object.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
JDatabaseImporterMySQL getImporter ()

Redefined in descendants as:
getNumRows (line 291)

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

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

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

Redefined in descendants as:
getQuery (line 306)

Get the current or query, or new JDatabaseQuery object.

  • return: The current value of the internal SQL variable or a new JDatabaseQuery object.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed getQuery ([boolean $new = false])
  • boolean $new: False to return the last query set, True to return a new JDatabaseQuery object.

Redefinition of:
JDatabase::getQuery()
Get the current query object or a new JDatabaseQuery object.

Redefined in descendants as:
getTableColumns (line 364)

Retrieves field information about a given table.

  • return: An array of fields for the database table.
  • since: 11.1
  • throws: JDatabaseException
  • 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:
JDatabase::getTableColumns()
Retrieves field information about the given tables.
getTableCreate (line 333)

Shows the table CREATE statement that creates the given tables.

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

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

Get the details list of keys for a table.

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

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

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

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

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

Get the version of the database connector.

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

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

Redefined in descendants as:
hasUTF (line 448)

Determines if the database engine supports UTF-8 character encoding.

  • return: True if supported.
  • deprecated: 12.1
  • since: 11.1
  • access: public
boolean hasUTF ()

Redefinition of:
JDatabase::hasUTF()
Determines if the database engine supports UTF-8 character encoding.

Redefined in descendants as:
insertid (line 461)

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.
  • since: 11.1
  • access: public
integer insertid ()

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

Redefined in descendants as:
lockTable (line 476)

Locks a table in the database.

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

Redefinition of:
JDatabase::lockTable()
Locks a table in the database.
queryBatch (line 799)

Execute a query batch.

  • return: A database resource if successful, false if not.
  • deprecated: 12.1
  • since: 11.1
  • access: public
mixed queryBatch ([boolean $abortOnError = true], [boolean $transactionSafe = false])
  • boolean $abortOnError: Abort on error.
  • boolean $transactionSafe: Transaction safe queries.

Redefinition of:
JDatabase::queryBatch()
Execute a query batch.

Redefined in descendants as:
renameTable (line 575)

Renames a table in the database.

  • return: Returns this object to support chaining.
  • since: 11.4
  • throws: JDatabaseException
  • access: public
JDatabase 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:
JDatabase::renameTable()
Renames a table in the database.
select (line 592)

Select a database for use.

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

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

Redefined in descendants as:
setUTF (line 625)

Set the connection to use UTF-8 character encoding.

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

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

Redefined in descendants as:
transactionCommit (line 638)

Method to commit a transaction.

  • since: 11.1
  • throws: JDatabaseException
  • access: public
void transactionCommit ()

Redefinition of:
JDatabase::transactionCommit()
Method to commit a transaction.
transactionRollback (line 652)

Method to roll back a transaction.

  • since: 11.1
  • throws: JDatabaseException
  • access: public
void transactionRollback ()

Redefinition of:
JDatabase::transactionRollback()
Method to roll back a transaction.
transactionStart (line 666)

Method to initialize a transaction.

  • since: 11.1
  • throws: JDatabaseException
  • access: public
void transactionStart ()

Redefinition of:
JDatabase::transactionStart()
Method to initialize a transaction.
unlockTables (line 849)

Unlocks tables in the database.

  • return: Returns this object to support chaining.
  • since: 11.4
  • throws: JDatabaseException
  • access: public
JDatabaseMySQL unlockTables ()

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

Inherited Methods

Inherited From JDatabase

JDatabase::__construct()
JDatabase::addQuoted()
JDatabase::connected()
JDatabase::debug()
JDatabase::dropTable()
JDatabase::escape()
JDatabase::execute()
JDatabase::explain()
JDatabase::fetchArray()
JDatabase::fetchAssoc()
JDatabase::fetchObject()
JDatabase::freeResult()
JDatabase::getAffectedRows()
JDatabase::getCollation()
JDatabase::getConnection()
JDatabase::getConnectors()
JDatabase::getCount()
JDatabase::getDatabase()
JDatabase::getDateFormat()
JDatabase::getErrorMsg()
JDatabase::getErrorNum()
JDatabase::getEscaped()
JDatabase::getInstance()
JDatabase::getLog()
JDatabase::getMinimum()
JDatabase::getNullDate()
JDatabase::getNumRows()
JDatabase::getPrefix()
JDatabase::getQuery()
JDatabase::getTableColumns()
JDatabase::getTableCreate()
JDatabase::getTableFields()
JDatabase::getTableKeys()
JDatabase::getTableList()
JDatabase::getTicker()
JDatabase::getUTFSupport()
JDatabase::getVersion()
JDatabase::hasUTF()
JDatabase::insertid()
JDatabase::insertObject()
JDatabase::isMinimumVersion()
JDatabase::isQuoted()
JDatabase::loadAssoc()
JDatabase::loadAssocList()
JDatabase::loadColumn()
JDatabase::loadNextObject()
JDatabase::loadNextRow()
JDatabase::loadObject()
JDatabase::loadObjectList()
JDatabase::loadResult()
JDatabase::loadResultArray()
JDatabase::loadRow()
JDatabase::loadRowList()
JDatabase::lockTable()
JDatabase::nameQuote()
JDatabase::query()
JDatabase::queryBatch()
JDatabase::quote()
JDatabase::quoteName()
JDatabase::quoteNameStr()
JDatabase::renameTable()
JDatabase::replacePrefix()
JDatabase::select()
JDatabase::setDebug()
JDatabase::setQuery()
JDatabase::setUTF()
JDatabase::splitSql()
JDatabase::stderr()
JDatabase::transactionCommit()
JDatabase::transactionRollback()
JDatabase::transactionStart()
JDatabase::truncateTable()
JDatabase::unlockTables()
JDatabase::updateObject()
JDatabase::__call()

Documentation generated on Mon, 25 Jun 2012 13:57:56 -0500 by phpDocumentor 1.4.4