Difference between revisions of "JDatabaseMySQLi"
From Joomla! Documentation
(Bulk upload by Doxiki2) |
m (preparing for archive only) |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | + | =={{JVer|11.1}} JDatabaseMySQLi== | |
− | + | ===Description=== | |
− | + | [[JDatabaseMySQLi]] is a concrete database handler class for [http://www.mysql.com/ 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.). | |
− | {{ | + | |
− | == | ||
− | |||
− | === | ||
− | [[ | ||
− | |||
− | [ | ||
− | |||
===Methods=== | ===Methods=== | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
+ | !Visibility | ||
!Method name | !Method name | ||
!Description | !Description | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::__destruct|__destruct]] |
+ | |Destructor. | ||
|- | |- | ||
− | | | + | |public |
− | + | |[[API17:JDatabaseMySQLi::connected|connected]] | |
− | |||
− | |[[JDatabaseMySQLi::connected | ||
|Determines if the connection to the server is active. | |Determines if the connection to the server is active. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::dateToString|dateToString]] |
+ | |Method to get a object represented as a datetime string in a format recognized by the database server. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::explain|explain]] |
+ | |Diagnostic method to return explain information for a query. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getAffectedRows|getAffectedRows]] |
+ | |Get the number of affected rows for the previous executed SQL statement. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getCollation|getCollation]] |
+ | |Method to get the database collation in use by sampling a text field of a table in the database. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getEscaped|getEscaped]] |
+ | |Method to escape a string for usage in an SQL statement. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getExporter|getExporter]] |
+ | |Gets an exporter class object. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getImporter|getImporter]] |
+ | |Gets an importer class object. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getNumRows|getNumRows]] |
+ | |Get the number of returned rows for the previous executed SQL statement. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getQuery|getQuery]] |
+ | |Get the current or query, or new object. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getTableCreate|getTableCreate]] |
+ | |Shows the table CREATE statement that creates the given tables. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getTableFields|getTableFields]] |
+ | |Retrieves field information about the given tables. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getTableList|getTableList]] |
+ | |Method to get an array of all tables in the database. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::getVersion|getVersion]] |
+ | |Get the version of the database connector. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::hasUTF|hasUTF]] |
+ | |Determines if the database engine supports UTF-8 character encoding. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::insertid|insertid]] |
+ | |Method to get the auto-incremented value from the last INSERT statement. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::query|query]] |
+ | |Execute the SQL statement. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::queryBatch|queryBatch]] |
+ | |Execute a query batch. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::select|select]] |
+ | |Select a database for use. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::setUTF|setUTF]] |
+ | |Set the connection to use UTF-8 character encoding. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::transactionCommit|transactionCommit]] |
+ | |Method to commit a transaction. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::transactionRollback|transactionRollback]] |
+ | |Method to roll back a transaction. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public |
− | | | + | |[[API17:JDatabaseMySQLi::transactionStart|transactionStart]] |
+ | |Method to initialize a transaction. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |public static |
− | | | + | |[[API17:JDatabaseMySQLi::test|test]] |
+ | |Test to see if the MySQL connector is available. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |protected |
− | | | + | |[[API17:JDatabaseMySQLi::__construct|__construct]] |
+ | |Constructor. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |protected |
− | | | + | |[[API17:JDatabaseMySQLi::fetchArray|fetchArray]] |
+ | |Method to fetch a row from the result set cursor as an array. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |protected |
− | | | + | |[[API17:JDatabaseMySQLi::fetchAssoc|fetchAssoc]] |
+ | |Method to fetch a row from the result set cursor as an associative array. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |protected |
− | | | + | |[[API17:JDatabaseMySQLi::fetchObject|fetchObject]] |
+ | |Method to fetch a row from the result set cursor as an object. | ||
|- | |- | ||
− | |[[JDatabaseMySQLi:: | + | |protected |
− | | | + | |[[API17:JDatabaseMySQLi::freeResult|freeResult]] |
+ | |Method to free up the memory used for the result set. | ||
|- | |- | ||
|} | |} | ||
+ | * '''Defined in''' libraries/joomla/database/database/mysqli.php | ||
+ | * '''Extends''' [[API17:JDatabase|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=== | ||
− | * [[ | + | * {{JVer|11.1}} '''JDatabaseMySQLi source code''' on [[jplatform:database/database/mysqli.php|BitBucket]] |
− | {{ | + | * {{JVer|11.1}} Subpackage [[API17:Subpackage Database|Database]] |
− | + | * [[API17:JDatabaseMySQLi|Other versions of JDatabaseMySQLi]] | |
− | + | ||
− | + | ||
− | ===Examples=== | + | ===User contributed notes=== |
− | + | === Code Examples === | |
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=JDatabaseMySQLi | category=JDatabaseMySQLi | ||
− | + | namespace=CodeExample | |
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
+ | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
− | <noinclude> | + | <noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude> |
Latest revision as of 21:40, 24 March 2017
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.
JDatabaseMySQLi[edit]
Description[edit]
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.).
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/mysqli.php
- Extends JDatabase
Importing[edit]
jimport( 'joomla.database.database.mysqli' );
See also[edit]
- JDatabaseMySQLi source code on BitBucket
- Subpackage Database
- Other versions of JDatabaseMySQLi
User contributed notes[edit]
Code Examples[edit]