Документация по Joomla 1.7

Joomla.Platform\JDatabase
libraries/joomla/database/database.php at line 33

Class JDatabase

JDatabase
All Implemented Interfaces:
JDatabaseInterface
All Known Subclasses:
JDatabaseMySQL JDatabaseMySQLi JDatabaseSQLAzure JDatabaseSQLSrv

public abstract class JDatabase

Database connector class.

Subpackage:
Database
Since:
11.1

Field Summary
protected resource The database connection resource.

$connection

protected integer The number of SQL statements executed by the database driver.

$count

protected resource The database connection cursor from the last query.

$cursor

protected bool The database driver debugging state.

$debug

protected string The database error message

$errorMsg

protected integer The database error number

$errorNum

protected bool If true then there are fields to be quoted for the query.

$hasQuoted

protected static array JDatabase instances container.

$instances

protected integer The affected row limit for the current SQL statement.

$limit

protected array The log of executed SQL statements by the database driver.

$log

string The name of the database driver.

$name

protected string 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.

$nameQuote

protected string 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.

$nullDate

protected integer The affected row offset to apply for the current SQL statement.

$offset

protected array The fields that are to be quoted.

$quoted

protected mixed The current SQL statement to execute.

$sql

protected string The common database table prefix.

$tablePrefix

protected bool True if the database engine supports UTF-8 character encoding.

$utf

Constructor Summary
protected void

__construct(array options)

Constructor.

Method Summary
static array

getConnectors()

Get a list of available database connectors.

static JDatabase

getInstance(array options)

Method to return a JDatabase instance based on the given options.

static array

splitSql(string Input, mixed sql)

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

string

__call(string method, array args)

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

void

addQuoted(mixed quoted)

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

abstract bool

connected()

Determines if the connection to the server is active.

abstract string

escape(string The, bool Optional, mixed text, bool extra)

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

protected abstract mixed

fetchArray(mixed cursor)

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

protected abstract mixed

fetchAssoc(mixed cursor)

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

protected abstract mixed

fetchObject(mixed cursor, string class)

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

protected abstract void

freeResult(mixed cursor)

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

abstract integer

getAffectedRows()

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

abstract mixed

getCollation()

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

resource

getConnection()

Method that provides access to the underlying database connection.

integer

getCount()

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

string

getDateFormat()

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

array

getLog()

Get the database driver SQL statement log.

string

getNullDate()

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

abstract integer

getNumRows(resource cursor)

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

string

getPrefix()

Get the common table prefix for the database driver.

abstract mixed

getQuery(bool new)

Get the current or query, or new JDatabaseQuery object.

abstract array

getTableColumns(mixed tables, bool typeOnly)

Retrieves field information about the given tables.

abstract array

getTableCreate(mixed tables)

Shows the table CREATE statement that creates the given tables.

abstract array

getTableKeys(mixed tables)

Retrieves field information about the given tables.

abstract array

getTableList()

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

bool

getUTFSupport()

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

abstract string

getVersion()

Get the version of the database connector

abstract boolean

hasUTF()

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

abstract integer

insertid()

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

bool

insertObject(string table, object object, string key)

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

mixed

loadAssoc()

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

mixed

loadAssocList(string key, string column)

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'].

mixed

loadColumn(integer offset)

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

mixed

loadNextObject(string class)

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

static mixed

loadNextRow()

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

static mixed

loadObject(string class)

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

mixed

loadObjectList(string key, string class)

Method to get an array of the result set rows from the database query where each row is an object.

mixed

loadResult()

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

mixed

loadRow()

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

mixed

loadRowList(string key)

Method to get an array of the result set rows from the database query where each row is an array.

abstract mixed

query()

Execute the SQL statement.

string

quote(string text, bool escape)

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

string

quoteName(string name)

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

string

replacePrefix(string sql, string prefix)

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

abstract bool

select(string database)

Select a database for use.

bool

setDebug(bool level)

Sets the database debugging state for the driver.

JDatabase

setQuery(mixed query, integer offset, integer limit)

Sets the SQL statement string for later execution.

abstract bool

setUTF()

Set the connection to use UTF-8 character encoding.

abstract void

transactionCommit()

Method to commit a transaction.

abstract void

transactionRollback()

Method to roll back a transaction.

abstract void

transactionStart()

Method to initialize a transaction.

bool

updateObject(string table, object object, string key, bool nulls)

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

void

debug(integer level)

Sets the debug level on or off

abstract string

explain()

Diagnostic method to return explain information for a query.

string

getErrorMsg(bool escaped)

Gets the error message from the database connection.

integer

getErrorNum()

Gets the error number from the database connection.

string

getEscaped(string The, bool Optional, mixed text, bool extra)

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

array

getTableFields(mixed tables, bool typeOnly)

Retrieves field information about the given tables.

integer

getTicker()

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

bool

isQuoted(string field)

Checks if field name needs to be quoted.

mixed

loadResultArray(integer offset)

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

string

nameQuote(string name)

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

abstract mixed

queryBatch(bool abortOnError, bool transactionSafe)

Execute a query batch.

string

stderr(bool True, bool showSQL)

Return the most recent error message for the database connector.

Field Detail

libraries/joomla/database/database.php at line 45

connection

protected resource The database connection resource. $connection

Since:
11.1

libraries/joomla/database/database.php at line 51

count

protected integer The number of SQL statements executed by the database driver. $count = 0

Since:
11.1

libraries/joomla/database/database.php at line 57

cursor

protected resource The database connection cursor from the last query. $cursor

Since:
11.1

libraries/joomla/database/database.php at line 63

debug

protected bool The database driver debugging state. $debug = false

Since:
11.1

libraries/joomla/database/database.php at line 129

errorMsg

protected string The database error message $errorMsg

Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 122

errorNum

protected integer The database error number $errorNum = 0

Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 136

hasQuoted

protected bool If true then there are fields to be quoted for the query. $hasQuoted = false

Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 149

instances

protected static array JDatabase instances container. $instances = array()

Since:
11.1

libraries/joomla/database/database.php at line 69

limit

protected integer The affected row limit for the current SQL statement. $limit = 0

Since:
11.1

libraries/joomla/database/database.php at line 75

log

protected array The log of executed SQL statements by the database driver. $log = array()

Since:
11.1

libraries/joomla/database/database.php at line 39

name

public string The name of the database driver. $name = 'md5'

Since:
11.1

libraries/joomla/database/database.php at line 84

nameQuote

protected string 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. $nameQuote

Since:
11.1

libraries/joomla/database/database.php at line 91

nullDate

protected string 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. $nullDate

Since:
11.1

libraries/joomla/database/database.php at line 97

offset

protected integer The affected row offset to apply for the current SQL statement. $offset = 0

Since:
11.1

libraries/joomla/database/database.php at line 143

quoted

protected array The fields that are to be quoted. $quoted = array()

Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 103

sql

protected mixed The current SQL statement to execute. $sql

Since:
11.1

libraries/joomla/database/database.php at line 109

tablePrefix

protected string The common database table prefix. $tablePrefix

Since:
11.1

libraries/joomla/database/database.php at line 115

utf

protected bool True if the database engine supports UTF-8 character encoding. $utf = false

Since:
11.1

Constructor Detail

libraries/joomla/database/database.php at line 391

__construct

protected void __construct(array options)

Constructor.

Parameters:
options - List of options used to configure the connection
Since:
11.1

Method Detail

libraries/joomla/database/database.php at line 160

getConnectors

public static array getConnectors()

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.

Returns:
An array of available database connectors.
Since:
11.1

libraries/joomla/database/database.php at line 225

getInstance

public static JDatabase getInstance(array options)

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.

Parameters:
options - Parameters to be passed to the database driver.
Returns:
A database object.
Since:
11.1

libraries/joomla/database/database.php at line 313

splitSql

public static array splitSql(string Input, mixed sql)

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

Parameters:
Input - SQL string with which to split into individual queries.
Returns:
The queries from the input string separated into an array.
Since:
11.1

libraries/joomla/database/database.php at line 364

__call

public string __call(string method, array args)

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

Parameters:
method - The called method.
args - The array of arguments passed to the method.
Returns:
The aliased method's return value or null.
Since:
11.1

libraries/joomla/database/database.php at line 420

addQuoted

public void addQuoted(mixed quoted)

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

Parameters:
quoted - Field name or array of names.
Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 442

connected

public abstract bool connected()

Determines if the connection to the server is active.

Returns:
True if connected to the database engine.
Since:
11.1

libraries/joomla/database/database.php at line 454

escape

public abstract string escape(string The, bool Optional, mixed text, bool extra)

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

Parameters:
The - string to be escaped.
Optional - parameter to provide extra escaping.
Returns:
The escaped string.
Since:
11.1

libraries/joomla/database/database.php at line 465

fetchArray

protected abstract mixed fetchArray(mixed cursor)

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

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database.php at line 476

fetchAssoc

protected abstract mixed fetchAssoc(mixed cursor)

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

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database.php at line 488

fetchObject

protected abstract mixed fetchObject(mixed cursor, string class)

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

Parameters:
cursor - The optional result set cursor from which to fetch the row.
class - The class name to use for the returned row object.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database.php at line 499

freeResult

protected abstract void freeResult(mixed cursor)

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

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Since:
11.1

libraries/joomla/database/database.php at line 508

getAffectedRows

public abstract integer getAffectedRows()

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

Returns:
The number of affected rows.
Since:
11.1

libraries/joomla/database/database.php at line 517

getCollation

public abstract mixed getCollation()

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

Returns:
The collation in use by the database or boolean false if not supported.
Since:
11.1

libraries/joomla/database/database.php at line 527

getConnection

public resource getConnection()

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.

Returns:
The underlying database connection resource.
Since:
11.1

libraries/joomla/database/database.php at line 539

getCount

public integer getCount()

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

Since:
11.1

libraries/joomla/database/database.php at line 551

getDateFormat

public string getDateFormat()

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

Returns:
The format string.
Since:
11.1

libraries/joomla/database/database.php at line 563

getLog

public array getLog()

Get the database driver SQL statement log.

Returns:
SQL statements executed by the database driver.
Since:
11.1

libraries/joomla/database/database.php at line 575

getNullDate

public string getNullDate()

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

Returns:
Null or zero representation of a timestamp.
Since:
11.1

libraries/joomla/database/database.php at line 589

getNumRows

public abstract integer getNumRows(resource cursor)

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

Parameters:
cursor - An optional database cursor resource to extract the row count from.
Returns:
The number of returned rows.
Since:
11.1

libraries/joomla/database/database.php at line 598

getPrefix

public string getPrefix()

Get the common table prefix for the database driver.

Returns:
The common database table prefix.
Since:
11.1

libraries/joomla/database/database.php at line 613

getQuery

public abstract mixed getQuery(bool new)

Get the current or query, or new JDatabaseQuery object.

Parameters:
new - False to return the last query set, True to return a new JDatabaseQuery object.
Returns:
The current value of the internal SQL variable or a new JDatabaseQuery object.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 626

getTableColumns

public abstract array getTableColumns(mixed tables, bool typeOnly)

Retrieves field information about the given tables.

Parameters:
tables - A table name or a list of table names.
typeOnly - True to only return field types.
Returns:
An array of fields by table.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 638

getTableCreate

public abstract array getTableCreate(mixed tables)

Shows the table CREATE statement that creates the given tables.

Parameters:
tables - A table name or a list of table names.
Returns:
A list of the create SQL for the tables.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 650

getTableKeys

public abstract array getTableKeys(mixed tables)

Retrieves field information about the given tables.

Parameters:
tables - A table name or a list of table names.
Returns:
An array of keys for the table(s).
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 660

getTableList

public abstract array getTableList()

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

Returns:
An array of all the tables in the database.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 669

getUTFSupport

public bool getUTFSupport()

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

Returns:
True if the database engine supports UTF-8 character encoding.
Since:
11.1

libraries/joomla/database/database.php at line 681

getVersion

public abstract string getVersion()

Get the version of the database connector

Returns:
The database connector version.
Since:
11.1

libraries/joomla/database/database.php at line 690

hasUTF

public abstract boolean hasUTF()

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

Returns:
True if supported.
Since:
11.1

libraries/joomla/database/database.php at line 699

insertid

public abstract integer insertid()

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

Returns:
The value of the auto-increment field from the last inserted row.
Since:
11.1

libraries/joomla/database/database.php at line 713

insertObject

public bool insertObject(string table, object object, string key)

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

Parameters:
table - The name of the database table to insert into.
object - A reference to an object whose public properties match the table fields.
key - The name of the primary key. If provided the object property is updated.
Returns:
True on success.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 764

loadAssoc

public mixed loadAssoc()

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

Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 802

loadAssocList

public mixed loadAssocList(string key, string column)

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.

Parameters:
key - The name of a field on which to key the result array.
column - An optional column name. Instead of the whole row, only this column value will be in the result array.
Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 841

loadColumn

public mixed loadColumn(integer offset)

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

Parameters:
offset - The row offset to use to build the result array.
Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 873

loadNextObject

public mixed loadNextObject(string class)

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

Parameters:
class - The class name to use for the returned row object.
Returns:
The result of the query as an array, false if there are no more rows.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 902

loadNextRow

public static mixed loadNextRow()

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

Returns:
The result of the query as an array, false if there are no more rows.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 933

loadObject

public static mixed loadObject(string class)

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

Parameters:
class - The class name to use for the returned row object.
Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 969

loadObjectList

public mixed loadObjectList(string key, string class)

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: Chosing to key the result array by a non-unique field name can result in unwanted behavior and should be avoided.

Parameters:
key - The name of a field on which to key the result array.
class - The class name to use for the returned row objects.
Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1004

loadResult

public mixed loadResult()

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

Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1034

loadRow

public mixed loadRow()

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.

Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1069

loadRowList

public mixed loadRowList(string key)

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: Chosing to key the result array by a non-unique field can result in unwanted behavior and should be avoided.

Parameters:
key - The name of a field on which to key the result array.
Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1104

query

public abstract mixed query()

Execute the SQL statement.

Returns:
A database cursor resource on success, boolean false on failure.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1116

quote

public string quote(string text, bool escape)

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

Parameters:
text - The string to quote.
escape - True to escape the string, false to leave it unchanged.
Returns:
The quoted input string.
Since:
11.1

libraries/joomla/database/database.php at line 1131

quoteName

public string quoteName(string name)

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

Parameters:
name - The identifier name to wrap in quotes.
Returns:
The quote wrapped name.
Since:
11.1

libraries/joomla/database/database.php at line 1160

replacePrefix

public string replacePrefix(string sql, string prefix)

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

Parameters:
sql - The SQL statement to prepare.
prefix - The common table prefix.
Returns:
The processed SQL statement.
Since:
11.1

libraries/joomla/database/database.php at line 1244

select

public abstract bool select(string database)

Select a database for use.

Parameters:
database - The name of the database to select for use.
Returns:
True if the database was successfully selected.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1255

setDebug

public bool setDebug(bool level)

Sets the database debugging state for the driver.

Parameters:
level - True to enable debugging.
Returns:
The old debugging level.
Since:
11.1

libraries/joomla/database/database.php at line 1274

setQuery

public JDatabase setQuery(mixed query, integer offset, integer limit)

Sets the SQL statement string for later execution.

Parameters:
query - The SQL statement to set either as a JDatabaseQuery object or a string.
offset - The affected row offset to set.
limit - The maximum affected rows to set.
Returns:
This object to support method chaining.
Since:
11.1

libraries/joomla/database/database.php at line 1290

setUTF

public abstract bool setUTF()

Set the connection to use UTF-8 character encoding.

Returns:
True on success.
Since:
11.1

libraries/joomla/database/database.php at line 1300

transactionCommit

public abstract void transactionCommit()

Method to commit a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1310

transactionRollback

public abstract void transactionRollback()

Method to roll back a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1320

transactionStart

public abstract void transactionStart()

Method to initialize a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1335

updateObject

public bool updateObject(string table, object object, string key, bool nulls)

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

Parameters:
table - The name of the database table to update.
object - A reference to an object whose public properties match the table fields.
key - The name of the primary key.
nulls - True to update null fields or false to ignore them.
Returns:
True on success.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database.php at line 1402

debug

public void debug(integer level)

Sets the debug level on or off

Parameters:
level - 0 to disable debugging and 1 to enable it.
Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 1418

explain

public abstract string explain()

Diagnostic method to return explain information for a query.

Returns:
The explain output.
Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 1430

getErrorMsg

public string getErrorMsg(bool escaped)

Gets the error message from the database connection.

Parameters:
escaped - True to escape the message string for use in JavaScript.
Returns:
The error message for the most recent query.
Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 1450

getErrorNum

public integer getErrorNum()

Gets the error number from the database connection.

Returns:
The error number for the most recent query.
Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 1469

getEscaped

public string getEscaped(string The, bool Optional, mixed text, bool extra)

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

Parameters:
The - string to be escaped.
Optional - parameter to provide extra escaping.
Returns:
The escaped string.
Since:
11.1
Deprecated:
11.1

libraries/joomla/database/database.php at line 1489

getTableFields

public array getTableFields(mixed tables, bool typeOnly)

Retrieves field information about the given tables.

Parameters:
tables - A table name or a list of table names.
typeOnly - True to only return field types.
Returns:
An array of fields by table.
Since:
11.1
Throws:
DatabaseException
Deprecated:
11.1

libraries/joomla/database/database.php at line 1514

getTicker

public integer getTicker()

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

Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 1532

isQuoted

public bool isQuoted(string field)

Checks if field name needs to be quoted.

Parameters:
field - The field name to be checked.
Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 1557

loadResultArray

public mixed loadResultArray(integer offset)

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

Parameters:
offset - The row offset to use to build the result array.
Returns:
The return value or null if the query failed.
Since:
11.1
Throws:
DatabaseException
Deprecated:
11.1

libraries/joomla/database/database.php at line 1576

nameQuote

public string nameQuote(string name)

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

Parameters:
name - The identifier name to wrap in quotes.
Returns:
The quote wrapped name.
Since:
11.1
Deprecated:
11.1

libraries/joomla/database/database.php at line 1592

queryBatch

public abstract mixed queryBatch(bool abortOnError, bool transactionSafe)

Execute a query batch.

Returns:
A database resource if successful, false if not.
Since:
11.1
Deprecated:
12.1

libraries/joomla/database/database.php at line 1604

stderr

public string stderr(bool True, bool showSQL)

Return the most recent error message for the database connector.

Parameters:
True - to display the SQL statement sent to the database as well as the error.
Returns:
The error message for the most recent query.
Since:
11.1
Deprecated:
12.1

Документация по Joomla 1.7