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