JDatabaseMySQL: Difference between revisions
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> | ||
===Methods=== | ===Methods=== | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
!Visibility | |||
!Method name | !Method name | ||
!Description | !Description | ||
|- | |- | ||
| | |public | ||
|[[JDatabaseMySQL::__destruct/11.1|__destruct]] | |[[JDatabaseMySQL::__destruct/11.1|__destruct]] | ||
| | |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 | |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]] | ||
| | |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]] | ||
| | |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 | |Gets an importer class object. | ||
|- | |- | ||
|public | |||
|[[JDatabaseMySQL::getNumRows/11.1|getNumRows]] | |[[JDatabaseMySQL::getNumRows/11.1|getNumRows]] | ||
| | |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 | |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]] | ||
| | |Method to get an array of all tables in the database. | ||
|- | |- | ||
|public | |||
|[[JDatabaseMySQL::getVersion/11.1|getVersion]] | |[[JDatabaseMySQL::getVersion/11.1|getVersion]] | ||
| | |Get the version of the database connector. | ||
|- | |- | ||
|public | |||
|[[JDatabaseMySQL::hasUTF/11.1|hasUTF]] | |[[JDatabaseMySQL::hasUTF/11.1|hasUTF]] | ||
|Determines UTF | |Determines if the database engine supports UTF-8 character encoding. | ||
|- | |- | ||
|public | |||
|[[JDatabaseMySQL::insertid/11.1|insertid]] | |[[JDatabaseMySQL::insertid/11.1|insertid]] | ||
| | |Method to get the auto-incremented value from the last INSERT statement. | ||
|- | |- | ||
|[[JDatabaseMySQL:: | |public | ||
| | |[[JDatabaseMySQL::query/11.1|query]] | ||
|Execute the SQL statement. | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |public | ||
| | |[[JDatabaseMySQL::queryBatch/11.1|queryBatch]] | ||
|Execute a query batch. | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |public | ||
| | |[[JDatabaseMySQL::select/11.1|select]] | ||
|Select a database for use. | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |public | ||
| | |[[JDatabaseMySQL::setUTF/11.1|setUTF]] | ||
|Set the connection to use UTF-8 character encoding. | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |public | ||
| | |[[JDatabaseMySQL::transactionCommit/11.1|transactionCommit]] | ||
|Method to commit a transaction. | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |public | ||
| | |[[JDatabaseMySQL::transactionRollback/11.1|transactionRollback]] | ||
|Method to roll back a transaction. | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |public | ||
| | |[[JDatabaseMySQL::transactionStart/11.1|transactionStart]] | ||
|Method to initialize a transaction. | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |public static | ||
| | |[[JDatabaseMySQL::test/11.1|test]] | ||
|Test to see if the MySQL connector is available. | |||
|- | |- | ||
| | |protected | ||
|[[JDatabaseMySQL::__construct/11.1|__construct]] | |||
|Constructor. | |||
|[[JDatabaseMySQL:: | |||
| | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |protected | ||
| | |[[JDatabaseMySQL::fetchArray/11.1|fetchArray]] | ||
|Method to fetch a row from the result set cursor as an array. | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |protected | ||
| | |[[JDatabaseMySQL::fetchAssoc/11.1|fetchAssoc]] | ||
|Method to fetch a row from the result set cursor as an associative array. | |||
|- | |- | ||
| | |protected | ||
|[[JDatabaseMySQL::fetchObject/11.1|fetchObject]] | |||
|Method to fetch a row from the result set cursor as an object. | |||
|[[JDatabaseMySQL:: | |||
| | |||
|- | |- | ||
|[[JDatabaseMySQL:: | |protected | ||
| | |[[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 | * {{JVer|11.1}} '''JDatabaseMySQL source code''' on [[jplatform:database/database/mysql.php|BitBucket]] | ||
* [[JDatabaseMySQL|Other versions of | * {{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> | ||
=== | ===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 22:57, 27 April 2011
JDatabaseMySQL
Description
Template:Description:JDatabaseMySQL [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/mysql.php
- Extends JDatabase
Importing
jimport( 'joomla.database.database.mysql' );
See also
JDatabaseMySQL source code on BitBucket
Subpackage Database- Other versions of JDatabaseMySQL
Template:SeeAlso:JDatabaseMySQL [Edit See Also]
User contributed notes
<CodeExamplesForm />