|
| __construct ($options) |
|
| connect () |
|
| disconnect () |
|
| escape ($text, $extra=false) |
|
| connected () |
|
| dropTable ($tableName, $ifExists=true) |
|
| getAffectedRows () |
|
| getCollation () |
|
| getConnectionCollation () |
|
| getNumRows ($cursor=null) |
|
| getTableCreate ($tables) |
|
| getTableColumns ($table, $typeOnly=true) |
|
| getTableKeys ($table) |
|
| getTableList () |
|
| getVersion () |
|
| insertid () |
|
| lockTable ($table) |
|
| execute () |
|
| renameTable ($oldTable, $newTable, $backup=null, $prefix=null) |
|
| select ($database) |
|
| setUtf () |
|
| transactionCommit ($toSavepoint=false) |
|
| transactionRollback ($toSavepoint=false) |
|
| transactionStart ($asSavepoint=false) |
|
| unlockTables () |
|
| __call ($method, $args) |
|
| __construct ($options) |
|
| alterDbCharacterSet ($dbName) |
|
| alterTableCharacterSet ($tableName, $rethrow=false) |
|
| connect () |
|
| connected () |
|
| createDatabase ($options, $utf=true) |
|
| __destruct () |
|
| disconnect () |
|
| addDisconnectHandler ($callable) |
|
| dropTable ($table, $ifExists=true) |
|
| escape ($text, $extra=false) |
|
| getAffectedRows () |
|
| getAlterDbCharacterSet ($dbName) |
|
| getAlterTableCharacterSet ($tableName) |
|
| convertUtf8mb4QueryToUtf8 ($query) |
|
| getCollation () |
|
| getConnectionCollation () |
|
| getConnection () |
|
| getCount () |
|
| getDateFormat () |
|
| getLog () |
|
| getTimings () |
|
| getCallStacks () |
|
| getMinimum () |
|
| getNullDate () |
|
| getNumRows ($cursor=null) |
|
| getPrefix () |
|
| getExporter () |
|
| getImporter () |
|
| getName () |
|
| getServerType () |
|
| getQuery ($new=false) |
|
| getIterator ($column=null, $class='stdClass') |
|
| getTableColumns ($table, $typeOnly=true) |
|
| getTableCreate ($tables) |
|
| getTableKeys ($table) |
|
| getTableList () |
|
| getUTFSupport () |
|
| hasUTFSupport () |
|
| hasUTF8mb4Support () |
|
| getVersion () |
|
| insertid () |
|
| insertObject ($table, &$object, $key=null) |
|
| isMinimumVersion () |
|
| loadAssoc () |
|
| loadAssocList ($key=null, $column=null) |
|
| loadColumn ($offset=0) |
|
| loadNextObject ($class='stdClass') |
|
| loadNextRow () |
|
| loadObject ($class='stdClass') |
|
| loadObjectList ($key='', $class='stdClass') |
|
| loadResult () |
|
| loadRow () |
|
| loadRowList ($index=null) |
|
| lockTable ($tableName) |
|
| quote ($text, $escape=true) |
|
| quoteBinary ($data) |
|
| quoteName ($name, $as=null) |
|
| replacePrefix ($sql, $prefix='#__') |
|
| renameTable ($oldTable, $newTable, $backup=null, $prefix=null) |
|
| select ($database) |
|
| setDebug ($level) |
|
| setQuery ($query, $offset=0, $limit=0) |
|
| setUtf () |
|
| transactionCommit ($toSavepoint=false) |
|
| transactionRollback ($toSavepoint=false) |
|
| transactionStart ($asSavepoint=false) |
|
| truncateTable ($table) |
|
| updateObject ($table, &$object, $key, $nulls=false) |
|
| execute () |
|
| unlockTables () |
|
| query () |
|
| getErrorMsg ($escaped=false) |
|
| getErrorNum () |
|
| stderr ($showSQL=false) |
|
MySQLi database driver
3.0.0
◆ __construct()
Constructor.
- Paramètres
-
array | $options | List of options used to configure the connection |
- Depuis
- 3.0.0
Références $options, et null.
◆ connect()
Connects to the database if needed.
- Renvoie
- void Returns void if the database connected successfully.
- Depuis
- 3.0.0
- Exceptions
-
Références elseif, et null.
◆ connected()
Determines if the connection to the server is active.
- Renvoie
- boolean True if connected to the database engine.
- Depuis
- 3.0.0
◆ disconnect()
Disconnects the database.
- Renvoie
- void
- Depuis
- 3.0.0
Références null.
◆ dropTable()
dropTable |
( |
|
$tableName, |
|
|
|
$ifExists = true |
|
) |
| |
Drops a table from the database.
- Paramètres
-
string | $tableName | The name of the database table to drop. |
boolean | $ifExists | Optionally specify that the table must exist before it is dropped. |
- Renvoie
- JDatabaseDriverMysqli Returns this object to support chaining.
- Depuis
- 3.0.1
- Exceptions
-
Références $query.
◆ escape()
escape |
( |
|
$text, |
|
|
|
$extra = false |
|
) |
| |
Method to escape a string for usage in an SQL statement.
- Paramètres
-
string | $text | The string to be escaped. |
boolean | $extra | Optional parameter to provide extra escaping. |
- Renvoie
- string The escaped string.
- Depuis
- 3.0.0
Références $text.
◆ execute()
Execute the SQL statement.
- Renvoie
- mixed A database cursor resource on success, boolean false on failure.
- Depuis
- 3.0.0
- Exceptions
-
Références $limit, $query, et null.
◆ fetchArray()
fetchArray |
( |
|
$cursor = null | ) |
|
|
protected |
Method to fetch a row from the result set cursor as an array.
- Paramètres
-
mixed | $cursor | The optional result set cursor from which to fetch the row. |
- Renvoie
- mixed Either the next row from the result set or false if there are no more rows.
- Depuis
- 3.0.0
◆ fetchAssoc()
fetchAssoc |
( |
|
$cursor = null | ) |
|
|
protected |
Method to fetch a row from the result set cursor as an associative array.
- Paramètres
-
mixed | $cursor | The optional result set cursor from which to fetch the row. |
- Renvoie
- mixed Either the next row from the result set or false if there are no more rows.
- Depuis
- 3.0.0
◆ fetchObject()
fetchObject |
( |
|
$cursor = null , |
|
|
|
$class = 'stdClass' |
|
) |
| |
|
protected |
Method to fetch a row from the result set cursor as an object.
- Paramètres
-
mixed | $cursor | The optional result set cursor from which to fetch the row. |
string | $class | The class name to use for the returned row object. |
- Renvoie
- mixed Either the next row from the result set or false if there are no more rows.
- Depuis
- 3.0.0
Références $class.
◆ freeResult()
freeResult |
( |
|
$cursor = null | ) |
|
|
protected |
Method to free up the memory used for the result set.
- Paramètres
-
mixed | $cursor | The optional result set cursor from which to fetch the row. |
- Renvoie
- void
- Depuis
- 3.0.0
Références null.
◆ getAffectedRows()
Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE for the previous executed SQL statement.
- Renvoie
- integer The number of affected rows.
- Depuis
- 3.0.0
◆ getCollation()
Method to get the database collation.
- Renvoie
- mixed The collation in use by the database (string) or boolean false if not supported.
- Depuis
- 3.0.1
- Exceptions
-
◆ getConnectionCollation()
getConnectionCollation |
( |
| ) |
|
Method to get the database connection collation, as reported by the driver. If the connector doesn't support reporting this value please return an empty string.
- Renvoie
- string
◆ getErrorMessage()
Return the actual SQL Error message
- Renvoie
- string The SQL Error message
- Depuis
- 3.4.6
◆ getErrorNumber()
Return the actual SQL Error number
- Renvoie
- integer The SQL Error number
- Depuis
- 3.4.6
◆ getNumRows()
getNumRows |
( |
|
$cursor = null | ) |
|
Get the number of returned rows for the previous executed SQL statement. This command is only valid for statements like SELECT or SHOW that return an actual result set. To retrieve the number of rows affected by an INSERT, UPDATE, REPLACE or DELETE query, use getAffectedRows().
- Paramètres
-
resource | $cursor | An optional database cursor resource to extract the row count from. |
- Renvoie
- integer The number of returned rows.
- Depuis
- 3.0.0
◆ getTableColumns()
getTableColumns |
( |
|
$table, |
|
|
|
$typeOnly = true |
|
) |
| |
Retrieves field information about a given table.
- Paramètres
-
string | $table | The name of the database table. |
boolean | $typeOnly | True to only return field types. |
- Renvoie
- array An array of fields for the database table.
- Depuis
- 3.0.1
- Exceptions
-
Références $field, et $fields.
◆ getTableCreate()
getTableCreate |
( |
|
$tables | ) |
|
Shows the table CREATE statement that creates the given tables.
- Paramètres
-
mixed | $tables | A table name or a list of table names. |
- Renvoie
- array A list of the create SQL for the tables.
- Depuis
- 3.0.0
- Exceptions
-
Références $row.
◆ getTableKeys()
Get the details list of keys for a table.
- Paramètres
-
string | $table | The name of the table. |
- Renvoie
- array An array of the column specification for the table.
- Depuis
- 3.0.1
- Exceptions
-
◆ getTableList()
Method to get an array of all tables in the database.
- Renvoie
- array An array of all the tables in the database.
- Depuis
- 3.0.1
- Exceptions
-
◆ getVersion()
Get the version of the database connector.
- Renvoie
- string The database connector version.
- Depuis
- 3.0.0
◆ hasProfiling()
Internal function to check if profiling is available
- Renvoie
- boolean
- Depuis
- 3.1.3
Références $row.
◆ hasQueryCacheEnabled()
Internal function to check if query cache is enabled.
- Renvoie
- boolean
- Depuis
- 3.9.25
Références $row.
◆ insertid()
Method to get the auto-incremented value from the last INSERT statement.
- Renvoie
- mixed The value of the auto-increment field from the last inserted row. If the value is greater than maximal int value, it will return a string.
- Depuis
- 3.0.0
◆ isSupported()
◆ lockTable()
Locks a table in the database.
- Paramètres
-
string | $table | The name of the table to unlock. |
- Renvoie
- JDatabaseDriverMysqli Returns this object to support chaining.
- Depuis
- 3.0.1
- Exceptions
-
◆ renameTable()
renameTable |
( |
|
$oldTable, |
|
|
|
$newTable, |
|
|
|
$backup = null , |
|
|
|
$prefix = null |
|
) |
| |
Renames a table in the database.
- Paramètres
-
string | $oldTable | The name of the table to be renamed |
string | $newTable | The new name for the table. |
string | $backup | Not used by MySQL. |
string | $prefix | Not used by MySQL. |
- Renvoie
- JDatabaseDriverMysqli Returns this object to support chaining.
- Depuis
- 3.0.1
- Exceptions
-
◆ select()
Select a database for use.
- Paramètres
-
string | $database | The name of the database to select for use. |
- Renvoie
- boolean True if the database was successfully selected.
- Depuis
- 3.0.0
- Exceptions
-
◆ serverClaimsUtf8mb4Support()
serverClaimsUtf8mb4Support |
( |
| ) |
|
|
private |
Does the database server claim to have support for UTF-8 Multibyte (utf8mb4) collation?
libmysql supports utf8mb4 since 5.5.3 (same version as the MySQL server). mysqlnd supports utf8mb4 since 5.0.9.
- Renvoie
- boolean
- Depuis
- CMS 3.5.0
◆ setUtf()
Set the connection to use UTF-8 character encoding.
- Renvoie
- boolean True on success.
- Depuis
- 3.0.0
If I could not set the utf8mb4 charset then the server doesn't support utf8mb4 despite claiming otherwise. This happens on old MySQL server versions (less than 5.5.3) using the mysqlnd PHP driver. Since mysqlnd masks the server version and reports only its own we can not be sure if the server actually does support UTF-8 Multibyte (i.e. it's MySQL 5.5.3 or later). Since the utf8mb4 charset is undefined in this case we catch the error and determine that utf8mb4 is not supported!
◆ transactionCommit()
transactionCommit |
( |
|
$toSavepoint = false | ) |
|
Method to commit a transaction.
- Paramètres
-
boolean | $toSavepoint | If true, commit to the last savepoint. |
- Renvoie
- void
- Depuis
- 3.0.1
- Exceptions
-
◆ transactionRollback()
transactionRollback |
( |
|
$toSavepoint = false | ) |
|
Method to roll back a transaction.
- Paramètres
-
boolean | $toSavepoint | If true, rollback to the last savepoint. |
- Renvoie
- void
- Depuis
- 3.0.1
- Exceptions
-
◆ transactionStart()
transactionStart |
( |
|
$asSavepoint = false | ) |
|
Method to initialize a transaction.
- Paramètres
-
boolean | $asSavepoint | If true and a transaction is already active, a savepoint will be created. |
- Renvoie
- void
- Depuis
- 3.0.1
- Exceptions
-
◆ unlockTables()
Unlocks tables in the database.
- Renvoie
- JDatabaseDriverMysqli Returns this object to support chaining.
- Depuis
- 3.0.0
- Exceptions
-
◆ $connection
◆ $dbMinimum
◆ $name
◆ $nameQuote
◆ $nullDate
$nullDate = '0000-00-00 00:00:00' |
|
protected |
◆ $serverType
La documentation de cette classe a été générée à partir du fichier suivant :