Joomla! Platform 11.4

Abstract Class JDatabase

Description

Implements interfaces:

Database connector class.

  • abstract:
  • since: 11.1

Located in /libraries/joomla/database/database.php (line 41)

Abstract class JDatabase   (Subpackage Database)
Direct descendents
Class Description
ClassJDatabaseSQLSrv SQL Server database driver
ClassJDatabaseMySQL MySQL database driver
Variable Summary
Static variable static array $instances
Variable resource $connection
Variable integer $count
Variable resource $cursor
Variable boolean $debug
Variable string $errorMsg
Variable integer $errorNum
Variable boolean $hasQuoted
Variable integer $limit
Variable array $log
Variable string $name
Variable string $nameQuote
Variable string $nullDate
Variable integer $offset
Variable array $quoted
Variable mixed $sql
Variable string $tablePrefix
Variable boolean $utf
Method Summary
Static method static array getConnectors ()
Static method static JDatabase getInstance ([array $options = array()])
Static method static array splitSql (string $sql)
Constructor JDatabase __construct (array $options)
Method void addQuoted (mixed $quoted)
Abstract method boolean connected ()
Method void debug (integer $level)
Abstract method JDatabase dropTable (string $table, [boolean $ifExists = true])
Abstract method string escape (string $text, [boolean $extra = false])
Abstract method string explain ()
Abstract method mixed fetchArray ([mixed $cursor = null])
Abstract method mixed fetchAssoc ([mixed $cursor = null])
Abstract method mixed fetchObject ([mixed $cursor = null], [string $class = 'stdClass'])
Abstract method void freeResult ([mixed $cursor = null])
Abstract method integer getAffectedRows ()
Abstract method mixed getCollation ()
Method resource getConnection ()
Method integer getCount ()
Method string getDatabase ()
Method string getDateFormat ()
Method string getErrorMsg ([boolean $escaped = false])
Method integer getErrorNum ()
Method string getEscaped (string $text, [boolean $extra = false])
Method array getLog ()
Method string getNullDate ()
Abstract method integer getNumRows ([resource $cursor = null])
Method string getPrefix ()
Abstract method JDatabaseQuery getQuery ([boolean $new = false])
Abstract method array getTableColumns (string $table, [boolean $typeOnly = true])
Abstract method array getTableCreate (mixed $tables)
Method array getTableFields (mixed $tables, [boolean $typeOnly = true])
Abstract method array getTableKeys (mixed $tables)
Abstract method array getTableList ()
Method integer getTicker ()
Method boolean getUTFSupport ()
Abstract method string getVersion ()
Abstract method boolean hasUTF ()
Abstract method integer insertid ()
Method boolean insertObject (string $table, object &$object, [string $key = null])
Method bool isQuoted (string $field)
Method mixed loadAssoc ()
Method mixed loadAssocList ([string $key = null], [string $column = null])
Method mixed loadColumn ([integer $offset = 0])
Method mixed loadNextObject ([string $class = 'stdClass'])
Method mixed loadNextRow ()
Method mixed loadObject ([string $class = 'stdClass'])
Method mixed loadObjectList ([string $key = ''], [string $class = 'stdClass'])
Method mixed loadResult ()
Method mixed loadResultArray ([integer $offset = 0])
Method mixed loadRow ()
Method mixed loadRowList ([string $key = null])
Abstract method JDatabase lockTable (string $tableName)
Method string nameQuote (string $name)
Abstract method mixed query ()
Abstract method mixed queryBatch ([boolean $abortOnError = true], [boolean $transactionSafe = false])
Method string quote (string $text, [boolean $escape = true])
Method mixed quoteName (mixed $name, [mixed $as = null])
Method string quoteNameStr (array $strArr)
Abstract method JDatabase renameTable (string $oldTable, string $newTable, [string $backup = null], [string $prefix = null])
Method string replacePrefix (string $sql, [string $prefix = '#__'])
Abstract method boolean select (string $database)
Method boolean setDebug (boolean $level)
Method JDatabase setQuery (mixed $query, [integer $offset = 0], [integer $limit = 0])
Abstract method boolean setUTF ()
Method string stderr ([boolean $showSQL = false])
Method void truncateTable (string $table)
Method boolean updateObject (string $table, object &$object, string $key, [boolean $nulls = false])
Method string __call (string $method, array $args)
Variables
resource $connection (line 63)
  • var: The database connection resource.
  • since: 11.1
  • access: protected
integer $count = 0 (line 69)
  • var: The number of SQL statements executed by the database driver.
  • since: 11.1
  • access: protected
resource $cursor (line 75)
  • var: The database connection cursor from the last query.
  • since: 11.1
  • access: protected
boolean $debug = false (line 81)
  • var: The database driver debugging state.
  • since: 11.1
  • access: protected
string $errorMsg (line 147)
  • var: The database error message
  • deprecated: 12.1
  • since: 11.1
  • access: protected
integer $errorNum = 0 (line 140)
  • var: The database error number
  • deprecated: 12.1
  • since: 11.1
  • access: protected
boolean $hasQuoted = false (line 154)
  • var: If true then there are fields to be quoted for the query.
  • deprecated: 12.1
  • since: 11.1
  • access: protected
array $instances = array() (line 167)
  • var: JDatabase instances container.
  • since: 11.1
  • access: protected
integer $limit = 0 (line 87)
  • var: The affected row limit for the current SQL statement.
  • since: 11.1
  • access: protected
array $log = array() (line 93)
  • var: The log of executed SQL statements by the database driver.
  • since: 11.1
  • access: protected
string $name (line 57)

The name of the database driver.

  • since: 11.1
  • access: public

Redefined in descendants as:
string $nameQuote (line 102)
  • var: 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

Redefined in descendants as:
  • JDatabaseSQLSrv::$nameQuote : 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.
  • JDatabaseMySQL::$nameQuote : 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.
string $nullDate (line 109)
  • var: 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

Redefined in descendants as:
  • JDatabaseSQLSrv::$nullDate : 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.
  • JDatabaseMySQL::$nullDate : 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.
integer $offset = 0 (line 115)
  • var: The affected row offset to apply for the current SQL statement.
  • since: 11.1
  • access: protected
array $quoted = array() (line 161)
  • var: The fields that are to be quoted.
  • deprecated: 12.1
  • since: 11.1
  • access: protected
mixed $sql (line 121)
  • var: The current SQL statement to execute.
  • since: 11.1
  • access: protected
string $tablePrefix (line 127)
  • var: The common database table prefix.
  • since: 11.1
  • access: protected
boolean $utf = true (line 133)
  • var: True if the database engine supports UTF-8 character encoding.
  • since: 11.1
  • access: protected
Methods
Constructor __construct (line 445)

Constructor.

  • since: 11.1
  • access: protected
JDatabase __construct (array $options)
  • array $options: List of options used to configure the connection

Redefined in descendants as:
addQuoted (line 471)

Adds a field or array of field names to the list that are to be quoted.

  • deprecated: 12.1
  • since: 11.1
  • access: public
void addQuoted (mixed $quoted)
  • mixed $quoted: Field name or array of names.
connected (line 495)

Determines if the connection to the server is active.

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

Redefined in descendants as:
debug (line 1635)

Sets the debug level on or off

  • deprecated: 12.1
  • since: 11.1
  • access: public
void debug (integer $level)
  • integer $level:
    1. to disable debugging and 1 to enable it.
dropTable (line 508)

Drops a table from the database.

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

Redefined in descendants as:
escape (line 520)

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

  • return: The escaped string.
  • abstract:
  • 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.

Redefined in descendants as:
explain (line 1651)

Diagnostic method to return explain information for a query.

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

Redefined in descendants as:
fetchArray (line 531)

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

Redefined in descendants as:
fetchAssoc (line 542)

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

Redefined in descendants as:
fetchObject (line 554)

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.
  • abstract:
  • 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.

Redefined in descendants as:
freeResult (line 565)

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

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

Redefined in descendants as:
getAffectedRows (line 574)

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

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

Redefined in descendants as:
getCollation (line 583)

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 or boolean false if not supported.
  • abstract:
  • since: 11.1
  • access: public
mixed getCollation ()

Redefined in descendants as:
getConnection (line 593)

Method that provides access to the underlying database connection. Useful for when you need to call a proprietary method such as postgresql's lo_* methods.

  • return: The underlying database connection resource.
  • since: 11.1
  • access: public
resource getConnection ()
getConnectors (line 178)

Get a list of available database connectors. The list will only be populated with connectors that both the class exists and the static test method returns true. This gives us the ability to have a multitude of connector classes that are self-aware as to whether or not they are able to be used on a given system.

  • return: An array of available database connectors.
  • since: 11.1
  • access: public
array getConnectors ()
getCount (line 605)

Get the total number of SQL statements executed by the database driver.

  • since: 11.1
  • access: public
integer getCount ()
getDatabase (line 617)

Gets the name of the database used by this conneciton.

  • since: 11.4
  • access: protected
string getDatabase ()
getDateFormat (line 629)

Returns a PHP date() function compliant date format for the database driver.

  • return: The format string.
  • since: 11.1
  • access: public
string getDateFormat ()
getErrorMsg (line 1663)

Gets the error message from the database connection.

  • return: The error message for the most recent query.
  • deprecated: 12.1
  • since: 11.1
  • access: public
string getErrorMsg ([boolean $escaped = false])
  • boolean $escaped: True to escape the message string for use in JavaScript.
getErrorNum (line 1686)

Gets the error number from the database connection.

  • return: The error number for the most recent query.
  • deprecated: 12.1
  • since: 11.1
  • access: public
integer getErrorNum ()
getEscaped (line 1705)

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

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

Method to return a JDatabase instance based on the given options. There are three global options and then

the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is used for the connection -- the default is 'mysql'. The 'database' option determines which database is to be used for the connection. The 'select' option determines whether the connector should automatically select the chosen database.

Instances are unique to the given options and new objects are only created when a unique options array is passed into the method. This ensures that we don't end up with unnecessary database connection resources.

  • return: A database object.
  • since: 11.1
  • access: public
JDatabase getInstance ([array $options = array()])
  • array $options: Parameters to be passed to the database driver.
getLog (line 641)

Get the database driver SQL statement log.

  • return: SQL statements executed by the database driver.
  • since: 11.1
  • access: public
array getLog ()
getNullDate (line 653)

Get the null or zero representation of a timestamp for the database driver.

  • return: Null or zero representation of a timestamp.
  • since: 11.1
  • access: public
string getNullDate ()
getNumRows (line 667)

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

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

Redefined in descendants as:
getPrefix (line 676)

Get the common table prefix for the database driver.

  • return: The common database table prefix.
  • since: 11.1
  • access: public
string getPrefix ()
getQuery (line 691)

Get the current query object or a new JDatabaseQuery object.

  • return: The current query object or a new object extending the JDatabaseQuery class.
  • abstract:
  • throws: JDatabaseException
  • since: 11.1
  • access: public
JDatabaseQuery getQuery ([boolean $new = false])
  • boolean $new: False to return the current query object, True to return a new JDatabaseQuery object.

Redefined in descendants as:
getTableColumns (line 704)

Retrieves field information about the given tables.

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

Redefined in descendants as:
getTableCreate (line 716)

Shows the table CREATE statement that creates the given tables.

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

Redefined in descendants as:
getTableFields (line 1725)

Retrieves field information about the given tables.

  • return: An array of fields by table.
  • deprecated: 12.1
  • throws: JDatabaseException
  • since: 11.1
  • access: public
array getTableFields (mixed $tables, [boolean $typeOnly = true])
  • mixed $tables: A table name or a list of table names.
  • boolean $typeOnly: True to only return field types.
getTableKeys (line 728)

Retrieves field information about the given tables.

  • return: An array of keys for the table(s).
  • abstract:
  • throws: JDatabaseException
  • since: 11.1
  • access: public
array getTableKeys (mixed $tables)
  • mixed $tables: A table name or a list of table names.

Redefined in descendants as:
getTableList (line 738)

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

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

Redefined in descendants as:
getTicker (line 1750)

Get the total number of SQL statements executed by the database driver.

  • deprecated: 12.1
  • since: 11.1
  • access: public
integer getTicker ()
getUTFSupport (line 747)

Determine whether or not the database engine supports UTF-8 character encoding.

  • return: True if the database engine supports UTF-8 character encoding.
  • since: 11.1
  • access: public
boolean getUTFSupport ()
getVersion (line 759)

Get the version of the database connector

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

Redefined in descendants as:
hasUTF (line 770)

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

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

Redefined in descendants as:
insertid (line 779)

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

Redefined in descendants as:
insertObject (line 793)

Inserts a row into a table based on an object's properties.

  • return: True on success.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
boolean insertObject (string $table, object &$object, [string $key = null])
  • string $table: The name of the database table to insert into.
  • object &$object: A reference to an object whose public properties match the table fields.
  • string $key: The name of the primary key. If provided the object property is updated.

Redefined in descendants as:
isQuoted (line 1768)

Checks if field name needs to be quoted.

  • deprecated: 12.1
  • since: 11.1
  • access: public
bool isQuoted (string $field)
  • string $field: The field name to be checked.
loadAssoc (line 848)

Method to get the first row of the result set from the database query as an associative array of ['field_name' => 'row_value'].

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadAssoc ()
loadAssocList (line 888)

Method to get an array of the result set rows from the database query where each row is an associative array of ['field_name' => 'row_value']. The array of rows can optionally be keyed by a field name, but defaults to a sequential numeric array.

NOTE: Chosing to key the result array by a non-unique field name can result in unwanted behavior and should be avoided.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadAssocList ([string $key = null], [string $column = null])
  • string $key: The name of a field on which to key the result array.
  • string $column: An optional column name. Instead of the whole row, only this column value will be in the result array.
loadColumn (line 930)

Method to get an array of values from the $offset field in each row of the result set from the database query.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadColumn (integer $offset)
  • integer $offset: The row offset to use to build the result array.
loadNextObject (line 963)

Method to get the next row in the result set from the database query as an object.

  • return: The result of the query as an array, false if there are no more rows.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadNextObject ([string $class = 'stdClass'])
  • string $class: The class name to use for the returned row object.
loadNextRow (line 994)

Method to get the next row in the result set from the database query as an array.

  • return: The result of the query as an array, false if there are no more rows.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadNextRow ()
loadObject (line 1027)

Method to get the first row of the result set from the database query as an object.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadObject ([string $class = 'stdClass'])
  • string $class: The class name to use for the returned row object.
loadObjectList (line 1065)

Method to get an array of the result set rows from the database query where each row is an object. The array of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.

NOTE: Choosing to key the result array by a non-unique field name can result in unwanted behavior and should be avoided.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadObjectList ([string $key = ''], [string $class = 'stdClass'])
  • string $key: The name of a field on which to key the result array.
  • string $class: The class name to use for the returned row objects.
loadResult (line 1103)

Method to get the first field of the first row of the result set from the database query.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadResult ()

Redefined in descendants as:
loadResultArray (line 1795)

Method to get an array of values from the $offset field in each row of the result set from the database query.

  • return: The return value or null if the query failed.
  • deprecated: 12.1
  • throws: JDatabaseException
  • since: 11.1
  • access: public
mixed loadResultArray (integer $offset)
  • integer $offset: The row offset to use to build the result array.
loadRow (line 1135)

Method to get the first row of the result set from the database query as an array. Columns are indexed numerically so the first column in the result set would be accessible via $row[0], etc.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadRow ()
loadRowList (line 1172)

Method to get an array of the result set rows from the database query where each row is an array. The array of objects can optionally be keyed by a field offset, but defaults to a sequential numeric array.

NOTE: Choosing to key the result array by a non-unique field can result in unwanted behavior and should be avoided.

  • return: The return value or null if the query failed.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
mixed loadRowList ([string $key = null])
  • string $key: The name of a field on which to key the result array.
lockTable (line 1212)

Locks a table in the database.

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

Redefined in descendants as:
nameQuote (line 1814)

Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.

  • return: The quote wrapped name.
  • deprecated: 12.1
  • since: 11.1
  • access: public
string nameQuote (string $name)
  • string $name: The identifier name to wrap in quotes.
query (line 1222)

Execute the SQL statement.

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

Redefined in descendants as:
queryBatch (line 1833)

Execute a query batch.

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

Redefined in descendants as:
quote (line 1234)

Method to quote and optionally escape a string to database requirements for insertion into the database.

  • return: The quoted input string.
  • since: 11.1
  • access: public
string quote (string $text, [boolean $escape = true])
  • string $text: The string to quote.
  • boolean $escape: True (default) to escape the string, false to leave it unchanged.
quoteName (line 1252)

Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.

  • return: The quote wrapped name, same type of $name.
  • since: 11.1
  • access: public
mixed quoteName (mixed $name, [mixed $as = null])
  • mixed $name: The identifier name to wrap in quotes, or an array of identifier names to wrap in quotes. Each type supports dot-notation name.
  • mixed $as: The AS query part associated to $name. It can be string or array, in latter case it has to be same length of $name; if is null there will not be any AS part for string or array element.
quoteNameStr (line 1299)

Quote strings coming from quoteName call.

  • return: Dot-imploded string of quoted parts.
  • since: 11.3
  • access: protected
string quoteNameStr (array $strArr)
  • array $strArr: Array of strings coming from quoteName dot-explosion.
renameTable (line 1432)

Renames a table in the database.

  • return: Returns this object to support chaining.
  • abstract:
  • throws: JDatabaseException
  • since: 11.4
  • 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: Table prefix
  • string $prefix: For the table - used to rename constraints in non-mysql databases

Redefined in descendants as:
replacePrefix (line 1335)

This function replaces a string identifier $prefix with the string held is the tablePrefix class variable.

  • return: The processed SQL statement.
  • since: 11.1
  • access: public
string replacePrefix (string $sql, [string $prefix = '#__'])
  • string $sql: The SQL statement to prepare.
  • string $prefix: The common table prefix.
select (line 1444)

Select a database for use.

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

Redefined in descendants as:
setDebug (line 1455)

Sets the database debugging state for the driver.

  • return: The old debugging level.
  • since: 11.1
  • access: public
boolean setDebug (boolean $level)
  • boolean $level: True to enable debugging.
setQuery (line 1474)

Sets the SQL statement string for later execution.

  • return: This object to support method chaining.
  • since: 11.1
  • access: public
JDatabase setQuery (mixed $query, integer $offset, integer $limit)
  • mixed $query: The SQL statement to set either as a JDatabaseQuery object or a string.
  • integer $offset: The affected row offset to set.
  • integer $limit: The maximum affected rows to set.
setUTF (line 1490)

Set the connection to use UTF-8 character encoding.

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

Redefined in descendants as:
splitSql (line 361)

Splits a string of multiple queries into an array of individual queries.

  • return: The queries from the input string separated into an array.
  • since: 11.1
  • access: public
array splitSql (string $sql)
  • string $sql: Input SQL string with which to split into individual queries.
stderr (line 1845)

Return the most recent error message for the database connector.

  • return: The error message for the most recent query.
  • deprecated: 12.1
  • since: 11.1
  • access: public
string stderr ([boolean $showSQL = false])
  • boolean $showSQL: True to display the SQL statement sent to the database as well as the error.
transactionCommit (line 1500)

Method to commit a transaction.

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

Redefined in descendants as:
transactionRollback (line 1510)

Method to roll back a transaction.

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

Redefined in descendants as:
transactionStart (line 1520)

Method to initialize a transaction.

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

Redefined in descendants as:
truncateTable (line 1532)

Method to truncate a table.

  • since: 11.3
  • throws: JDatabaseException
  • access: public
void truncateTable (string $table)
  • string $table: The table to truncate
unlockTables (line 1619)

Unlocks tables in the database.

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

Redefined in descendants as:
updateObject (line 1551)

Updates a row in a table based on an object's properties.

  • return: True on success.
  • since: 11.1
  • throws: JDatabaseException
  • access: public
boolean updateObject (string $table, object &$object, string $key, [boolean $nulls = false])
  • string $table: The name of the database table to update.
  • object &$object: A reference to an object whose public properties match the table fields.
  • string $key: The name of the primary key.
  • boolean $nulls: True to update null fields or false to ignore them.
__call (line 419)

Magic method to provide method alias support for quote() and quoteName().

  • return: The aliased method's return value or null.
  • since: 11.1
  • access: public
string __call (string $method, array $args)
  • string $method: The called method.
  • array $args: The array of arguments passed to the method.
/html>