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