Actions

API17

Difference between revisions of "JDatabaseMySQLi"

From Joomla! Documentation

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

Revision as of 17:57, 27 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.

Joomla 11.1 JDatabaseMySQLi

Description

JDatabaseMySQLi is a concrete database handler class for MySQL. The MySQLi driver can only be used for MySQL 4.1 and higher. The "i" at the end stands for "improved" (faster, better, etc.). [Edit Descripton]

Methods

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/mysqli.php
  • Extends JDatabase

Importing

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

See also

SeeAlso:JDatabaseMySQLi [Edit See Also]

User contributed notes

<CodeExamplesForm />