API17

Difference between revisions of "JDatabaseMySQL"

From Joomla! Documentation

(Layout updates)
(Updated to r1448:247ba8d88526)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 +
=={{JVer|11.1}} JDatabaseMySQL==
 +
===Description===
 +
{{Description:JDatabaseMySQL}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[Description:JDatabaseMySQL|Edit Descripton]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[Description:JDatabaseMySQL|Edit Descripton]]<nowiki>]</nowiki>
 
</span>
 
</span>
{{Description:JDatabaseMySQL}}
 
===Defined in===
 
libraries/joomla/database/database/mysql.php
 
* see source code in [[jplatform:database/database/mysql.php|BitBucket]]
 
===Subpackage===
 
[[Subpackage Database/11.1|Database]]
 
===Extends===
 
[[JDatabase/11.1|JDatabase]]
 
===Extended by===
 
 
===Methods===
 
===Methods===
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
 +
!Visibility
 
!Method name
 
!Method name
 
!Description
 
!Description
 
|-
 
|-
|[[JDatabaseMySQL::__construct/11.1|__construct]]
+
|public
|Database object constructor.
 
|-
 
 
|[[JDatabaseMySQL::__destruct/11.1|__destruct]]
 
|[[JDatabaseMySQL::__destruct/11.1|__destruct]]
|Database object destructor.  
+
|Destructor.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::connected/11.1|connected]]
 
|[[JDatabaseMySQL::connected/11.1|connected]]
 
|Determines if the connection to the server is active.  
 
|Determines if the connection to the server is active.  
 
|-
 
|-
 +
|public
 +
|[[JDatabaseMySQL::dateToString/11.1|dateToString]]
 +
|Method to get a  object represented as a datetime string in a format recognized by the database server.
 +
|-
 +
|public
 
|[[JDatabaseMySQL::explain/11.1|explain]]
 
|[[JDatabaseMySQL::explain/11.1|explain]]
|Diagnostic function.  
+
|Diagnostic method to return explain information for a query.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getAffectedRows/11.1|getAffectedRows]]
 
|[[JDatabaseMySQL::getAffectedRows/11.1|getAffectedRows]]
|
+
|Get the number of affected rows for the previous executed SQL statement.
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getCollation/11.1|getCollation]]
 
|[[JDatabaseMySQL::getCollation/11.1|getCollation]]
|Assumes database collation in use by sampling one text field in one table.  
+
|Method to get the database collation in use by sampling a text field of a table in the database.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getEscaped/11.1|getEscaped]]
 
|[[JDatabaseMySQL::getEscaped/11.1|getEscaped]]
|Get a database escaped string.  
+
|Method to escape a string for usage in an SQL statement.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getExporter/11.1|getExporter]]
 
|[[JDatabaseMySQL::getExporter/11.1|getExporter]]
 
|Gets an exporter class object.  
 
|Gets an exporter class object.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getImporter/11.1|getImporter]]
 
|[[JDatabaseMySQL::getImporter/11.1|getImporter]]
|Gets an exporter class object.  
+
|Gets an importer class object.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getNumRows/11.1|getNumRows]]
 
|[[JDatabaseMySQL::getNumRows/11.1|getNumRows]]
|Description.  
+
|Get the number of returned rows for the previous executed SQL statement.  
 
|-
 
|-
 +
|public
 +
|[[JDatabaseMySQL::getQuery/11.1|getQuery]]
 +
|Get the current or query, or new  object.
 +
|-
 +
|public
 
|[[JDatabaseMySQL::getTableCreate/11.1|getTableCreate]]
 
|[[JDatabaseMySQL::getTableCreate/11.1|getTableCreate]]
|Shows the CREATE TABLE statement that creates the given tables.  
+
|Shows the table CREATE statement that creates the given tables.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getTableFields/11.1|getTableFields]]
 
|[[JDatabaseMySQL::getTableFields/11.1|getTableFields]]
|Retrieves information about the given tables.  
+
|Retrieves field information about the given tables.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getTableList/11.1|getTableList]]
 
|[[JDatabaseMySQL::getTableList/11.1|getTableList]]
|Description.  
+
|Method to get an array of all tables in the database.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::getVersion/11.1|getVersion]]
 
|[[JDatabaseMySQL::getVersion/11.1|getVersion]]
|Description.  
+
|Get the version of the database connector.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::hasUTF/11.1|hasUTF]]
 
|[[JDatabaseMySQL::hasUTF/11.1|hasUTF]]
|Determines UTF support.  
+
|Determines if the database engine supports UTF-8 character encoding.  
 
|-
 
|-
 +
|public
 
|[[JDatabaseMySQL::insertid/11.1|insertid]]
 
|[[JDatabaseMySQL::insertid/11.1|insertid]]
|Description.  
+
|Method to get the auto-incremented value from the last INSERT statement.  
 
|-
 
|-
|[[JDatabaseMySQL::insertObject/11.1|insertObject]]
+
|public
|Inserts a row into a table based on an objects properties.  
+
|[[JDatabaseMySQL::query/11.1|query]]
 +
|Execute the SQL statement.  
 
|-
 
|-
|[[JDatabaseMySQL::loadAssoc/11.1|loadAssoc]]
+
|public
|Fetch a result row as an associative array.  
+
|[[JDatabaseMySQL::queryBatch/11.1|queryBatch]]
 +
|Execute a query batch.  
 
|-
 
|-
|[[JDatabaseMySQL::loadAssocList/11.1|loadAssocList]]
+
|public
|Load a assoc list of database rows.  
+
|[[JDatabaseMySQL::select/11.1|select]]
 +
|Select a database for use.  
 
|-
 
|-
|[[JDatabaseMySQL::loadNextObject/11.1|loadNextObject]]
+
|public
|Load the next row returned by the query.  
+
|[[JDatabaseMySQL::setUTF/11.1|setUTF]]
 +
|Set the connection to use UTF-8 character encoding.  
 
|-
 
|-
|[[JDatabaseMySQL::loadNextRow/11.1|loadNextRow]]
+
|public
|Load the next row returned by the query.  
+
|[[JDatabaseMySQL::transactionCommit/11.1|transactionCommit]]
 +
|Method to commit a transaction.  
 
|-
 
|-
|[[JDatabaseMySQL::loadObject/11.1|loadObject]]
+
|public
|This global function loads the first row of a query into an object.  
+
|[[JDatabaseMySQL::transactionRollback/11.1|transactionRollback]]
 +
|Method to roll back a transaction.  
 
|-
 
|-
|[[JDatabaseMySQL::loadObjectList/11.1|loadObjectList]]
+
|public
|Load a list of database objects.  
+
|[[JDatabaseMySQL::transactionStart/11.1|transactionStart]]
 +
|Method to initialize a transaction.  
 
|-
 
|-
|[[JDatabaseMySQL::loadResult/11.1|loadResult]]
+
|public static
|This method loads the first field of the first row returned by the query.  
+
|[[JDatabaseMySQL::test/11.1|test]]
 +
|Test to see if the MySQL connector is available.  
 
|-
 
|-
|[[JDatabaseMySQL::loadResultArray/11.1|loadResultArray]]
+
|protected
|Load an array of single field results into an array.
+
|[[JDatabaseMySQL::__construct/11.1|__construct]]
|-
+
|Constructor.  
|[[JDatabaseMySQL::loadRow/11.1|loadRow]]
 
|Description.  
 
 
|-
 
|-
|[[JDatabaseMySQL::loadRowList/11.1|loadRowList]]
+
|protected
|Load a list of database rows (numeric column indexing).  
+
|[[JDatabaseMySQL::fetchArray/11.1|fetchArray]]
 +
|Method to fetch a row from the result set cursor as an array.  
 
|-
 
|-
|[[JDatabaseMySQL::query/11.1|query]]
+
|protected
|Execute the query.  
+
|[[JDatabaseMySQL::fetchAssoc/11.1|fetchAssoc]]
 +
|Method to fetch a row from the result set cursor as an associative array.  
 
|-
 
|-
|[[JDatabaseMySQL::queryBatch/11.1|queryBatch]]
+
|protected
|Execute a batch query.
+
|[[JDatabaseMySQL::fetchObject/11.1|fetchObject]]
|-
+
|Method to fetch a row from the result set cursor as an object.  
|[[JDatabaseMySQL::select/11.1|select]]
 
|Select a database for use.
 
|-
 
|[[JDatabaseMySQL::setUTF/11.1|setUTF]]
 
|Custom settings for UTF support.
 
|-
 
|[[JDatabaseMySQL::test/11.1|test]]
 
|Test to see if the MySQL connector is available.  
 
 
|-
 
|-
|[[JDatabaseMySQL::updateObject/11.1|updateObject]]
+
|protected
|Description.  
+
|[[JDatabaseMySQL::freeResult/11.1|freeResult]]
 +
|Method to free up the memory used for the result set.  
 
|-
 
|-
 
|}
 
|}
 +
* '''Defined in''' libraries/joomla/database/database/mysql.php
 +
* '''Extends''' [[JDatabase/11.1|JDatabase]]
 
===Importing===
 
===Importing===
 
<source lang="php">jimport( 'joomla.database.database.mysql' );</source>
 
<source lang="php">jimport( 'joomla.database.database.mysql' );</source>
 
===See also===
 
===See also===
* JDatabaseMySQL source code in [[jplatform:database/database/mysql.php|BitBucket]]
+
* {{JVer|11.1}} '''JDatabaseMySQL source code''' on [[jplatform:database/database/mysql.php|BitBucket]]
* [[JDatabaseMySQL|Other versions of this class]]
+
* {{JVer|11.1}} Subpackage [[Subpackage Database/11.1|Database]]
 +
* [[JDatabaseMySQL|Other versions of JDatabaseMySQL]]
 
{{SeeAlso:JDatabaseMySQL}}
 
{{SeeAlso:JDatabaseMySQL}}
 
<span class="editsection" style="font-size:76%;">
 
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JDatabaseMySQL|Edit See Also]]<nowiki>]</nowiki>
 
<nowiki>[</nowiki>[[SeeAlso:JDatabaseMySQL|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
</span>
===Examples===
+
===User contributed notes===
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 135: Line 154:
 
category=ClassExample
 
category=ClassExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
 
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JDatabaseMySQL]]</noinclude>
 
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JDatabaseMySQL]]</noinclude>

Revision as of 17:57, 27 April 2011

The "API17" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Joomla 11.1 JDatabaseMySQL[edit]

Description[edit]

Template:Description:JDatabaseMySQL [Edit Descripton]

Methods[edit]

Visibility Method name Description
public __destruct Destructor.
public connected Determines if the connection to the server is active.
public dateToString Method to get a object represented as a datetime string in a format recognized by the database server.
public explain Diagnostic method to return explain information for a query.
public getAffectedRows Get the number of affected rows for the previous executed SQL statement.
public getCollation Method to get the database collation in use by sampling a text field of a table in the database.
public getEscaped Method to escape a string for usage in an SQL statement.
public getExporter Gets an exporter class object.
public getImporter Gets an importer class object.
public getNumRows Get the number of returned rows for the previous executed SQL statement.
public getQuery Get the current or query, or new object.
public getTableCreate Shows the table CREATE statement that creates the given tables.
public getTableFields Retrieves field information about the given tables.
public getTableList Method to get an array of all tables in the database.
public getVersion Get the version of the database connector.
public hasUTF Determines if the database engine supports UTF-8 character encoding.
public insertid Method to get the auto-incremented value from the last INSERT statement.
public query Execute the SQL statement.
public queryBatch Execute a query batch.
public select Select a database for use.
public setUTF Set the connection to use UTF-8 character encoding.
public transactionCommit Method to commit a transaction.
public transactionRollback Method to roll back a transaction.
public transactionStart Method to initialize a transaction.
public static test Test to see if the MySQL connector is available.
protected __construct Constructor.
protected fetchArray Method to fetch a row from the result set cursor as an array.
protected fetchAssoc Method to fetch a row from the result set cursor as an associative array.
protected fetchObject Method to fetch a row from the result set cursor as an object.
protected freeResult Method to free up the memory used for the result set.
  • Defined in libraries/joomla/database/database/mysql.php
  • Extends JDatabase

Importing[edit]

jimport( 'joomla.database.database.mysql' );

See also[edit]

Template:SeeAlso:JDatabaseMySQL [Edit See Also]

User contributed notes[edit]

<CodeExamplesForm />