Actions

API17

Difference between revisions of "JDatabase"

From Joomla! Documentation

(Bulk upload by Doxiki2)
 
(Layout updates)
Line 6: Line 6:
 
===Defined in===
 
===Defined in===
 
libraries/joomla/database/database.php
 
libraries/joomla/database/database.php
 +
* see source code in [[jplatform:database/database.php|BitBucket]]
 
===Subpackage===
 
===Subpackage===
 
[[Subpackage Database/11.1|Database]]
 
[[Subpackage Database/11.1|Database]]
Line 173: Line 174:
 
<source lang="php">jimport( 'joomla.database.database' );</source>
 
<source lang="php">jimport( 'joomla.database.database' );</source>
 
===See also===
 
===See also===
 +
* JDatabase source code in [[jplatform:database/database.php|BitBucket]]
 
* [[JDatabase|Other versions of this class]]
 
* [[JDatabase|Other versions of this class]]
 
{{SeeAlso:JDatabase}}
 
{{SeeAlso:JDatabase}}

Revision as of 17:51, 23 April 2011

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

[Edit Descripton] JDatabase is an abstract class which is extended by specific database drivers. It provides database connections for Joomla.

Defined in

libraries/joomla/database/database.php

Subpackage

Database

Extends

JObject

Extended by

Methods

Method name Description
__construct Database object constructor.
__destruct Database object destructor.
addQuoted Adds a field or array of field names to the list that are to be quoted.
connected Determines if the connection to the server is active.
debug Sets the debug level on or off.
explain Diagnostic function.
getAffectedRows Get the affected rows by the most recent query.
getCollation Get the database collation.
getConnection Get the connection.
getConnectors Get the database connectors.
getErrorMsg Get the error message.
getErrorNum Get the error number.
getEscaped Get a database escaped string.
getLog Get a database error log.
getNullDate Get the database null date.
getNumRows Get the number of rows returned by the most recent query.
getPrefix Get the database table prefix.
getQuery Get the current or query, or new object.
getTableCreate Shows the CREATE TABLE statement that creates the given tables.
getTableFields Retrieves information about the given tables.
getTableList List tables in a database.
getTicker Get the total number of queries made.
getUTFSupport Get the database UTF-8 support.
getVersion Get the version of the database connector.
hasUTF Determines UTF support.
insertid Get the ID generated from the previous INSERT operation.
insertObject Inserts a row into a table based on an objects properties.
isQuoted Checks if field name needs to be quoted.
loadAssoc Fetch a result row as an associative array.
loadAssocList Load a associactive list of database rows.
loadNextObject Load the next row returned by the query.
loadNextRow Load the next row returned by the query.
loadObject This global function loads the first row of a query into an object.
loadObjectList Load a list of database objects.
loadResult This method loads the first field of the first row returned by the query.
loadResultArray Load an array of single field results into an array.
loadRow Load the first row returned by the query.
loadRowList Load a list of database rows (numeric column indexing).
nameQuote Quote an identifier name (field, table, etc).
query Execute the query.
queryBatch Execute a batch query.
quote Get a quoted database escaped string.
replacePrefix This function replaces a string identifier with the string held is the class variable.
setQuery Sets the SQL query string for later execution.
setUTF Custom settings for UTF support.
splitSql Splits a string of queries into an array of individual queries.
stderr Print out an error statement.
test Test to see if the MySQLi connector is available.
updateObject Update an object in the database.
getInstance Returns the global Database object, only creating it if it doesn't already exist.

Importing

jimport( 'joomla.database.database' );

See also

[Edit See Also]

Examples

<CodeExamplesForm />