Документация по Joomla 1.7

Joomla.Platform\JDatabaseMySQLi
libraries/joomla/database/database/mysqli.php at line 24

Class JDatabaseMySQLi

JDatabase
└─JDatabaseMySQLi

public class JDatabaseMySQLi
extends JDatabase

MySQLi database driver

Subpackage:
Database
See Also:
http://php.net/manual/en/book.mysqli.php
Since:
11.1

Field Summary
string

$name

The name of the database driver.

protected string

$nameQuote

The character(s) used to quote SQL statement names such as table names or field names, etc.

protected string

$nullDate

The null or zero representation of a timestamp for the database driver.

Fields inherited from Joomla.Platform\JDatabase
connection, count, cursor, debug, errorMsg, errorNum, hasQuoted, instances, limit, log, name, nameQuote, nullDate, offset, quoted, sql, tablePrefix, utf
Constructor Summary
protected void

__construct(array options)

Constructor.

Method Summary
string

escape(string text, bool extra, string The, bool Optional)

Method to escape a string for usage in an SQL statement.

static boolean

test()

Test to see if the MySQL connector is available.

boolean

connected()

Determines if the connection to the server is active.

JDatabaseSQLSrv

dropTable(string tableName, boolean ifExists)

Drops a table from the database.

integer

getAffectedRows()

Get the number of affected rows for the previous executed SQL statement.

mixed

getCollation()

Method to get the database collation in use by sampling a text field of a table in the database.

JDatabaseExporterMySQLi

getExporter()

Gets an exporter class object.

JDatabaseImporterMySQLi

getImporter()

Gets an importer class object.

integer

getNumRows(resource cursor)

Get the number of returned rows for the previous executed SQL statement.

mixed

getQuery(boolean new)

Get the current or query, or new JDatabaseQuery object.

array

getTableCreate(mixed tables)

Shows the table CREATE statement that creates the given tables.

array

getTableColumns(string table, bool typeOnly, mixed tables)

Retrieves field information about a given table.

array

getTableKeys(string table, mixed tables)

Get the details list of keys for a table.

array

getTableList()

Method to get an array of all tables in the database.

string

getVersion()

Get the version of the database connector.

boolean

hasUTF()

Determines if the database engine supports UTF-8 character encoding.

integer

insertid()

Method to get the auto-incremented value from the last INSERT statement.

mixed

query()

Execute the SQL statement.

boolean

select(string database)

Select a database for use.

bool

setUTF()

Set the connection to use UTF-8 character encoding.

void

transactionCommit()

Method to commit a transaction.

void

transactionRollback()

Method to roll back a transaction.

void

transactionStart()

Method to initialize a transaction.

protected mixed

fetchArray(mixed cursor)

Method to fetch a row from the result set cursor as an array.

protected mixed

fetchAssoc(mixed cursor)

Method to fetch a row from the result set cursor as an associative array.

protected mixed

fetchObject(mixed cursor, string class)

Method to fetch a row from the result set cursor as an object.

protected void

freeResult(mixed cursor)

Method to free up the memory used for the result set.

string

explain()

Diagnostic method to return explain information for a query.

mixed

queryBatch(bool abortOnError, bool transactionSafe)

Execute a query batch.

Methods inherited from Joomla.Platform\JDatabase
__call, __construct, addQuoted, connected, debug, escape, explain, fetchArray, fetchAssoc, fetchObject, freeResult, getAffectedRows, getCollation, getConnection, getConnectors, getCount, getDateFormat, getErrorMsg, getErrorNum, getEscaped, getInstance, getLog, getNullDate, getNumRows, getPrefix, getQuery, getTableColumns, getTableCreate, getTableFields, getTableKeys, getTableList, getTicker, getUTFSupport, getVersion, hasUTF, insertObject, insertid, isQuoted, loadAssoc, loadAssocList, loadColumn, loadNextObject, loadNextRow, loadObject, loadObjectList, loadResult, loadResultArray, loadRow, loadRowList, nameQuote, query, queryBatch, quote, quoteName, replacePrefix, select, setDebug, setQuery, setUTF, splitSql, stderr, transactionCommit, transactionRollback, transactionStart, updateObject

Field Detail

libraries/joomla/database/database/mysqli.php at line 32

name

public string $name = 'mysqli'

The name of the database driver.

Since:
11.1

libraries/joomla/database/database/mysqli.php at line 43

nameQuote

protected string $nameQuote = '`'

The character(s) used to quote SQL statement names such as table names or field names, etc. The child classes should define this as necessary. If a single character string the same character is used for both sides of the quoted name, else the first character will be used for the opening quote and the second for the closing quote.

Since:
11.1

libraries/joomla/database/database/mysqli.php at line 52

nullDate

protected string $nullDate = '0000-00-00 00:00:00'

The null or zero representation of a timestamp for the database driver. This should be defined in child classes to hold the appropriate value for the engine.

Since:
11.1

Constructor Detail

libraries/joomla/database/database/mysqli.php at line 63

__construct

protected void __construct(array options)

Constructor.

Parameters:
options - List of options used to configure the connection
Since:
11.1

Method Detail

libraries/joomla/database/database/mysqli.php at line 163

escape

public string escape(string text, bool extra, string The, bool Optional)

Method to escape a string for usage in an SQL statement.

Parameters:
text - The string to be escaped.
extra - Optional parameter to provide extra escaping.
Returns:
The escaped string.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 181

test

public static boolean test()

Test to see if the MySQL connector is available.

Returns:
True on success, false otherwise.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 193

connected

public boolean connected()

Determines if the connection to the server is active.

Returns:
True if connected to the database engine.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 207

dropTable

public JDatabaseSQLSrv dropTable(string tableName, boolean ifExists)

Drops a table from the database.

Parameters:
tableName - The name of the database table to drop.
ifExists - Optionally specify that the table must exist before it is dropped.
Returns:
Returns this object to support chaining.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 229

getAffectedRows

public integer getAffectedRows()

Get the number of affected rows for the previous executed SQL statement.

Returns:
The number of affected rows.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 241

getCollation

public mixed getCollation()

Method to get the database collation in use by sampling a text field of a table in the database.

Returns:
The collation in use by the database or boolean false if not supported.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 260

getExporter

public JDatabaseExporterMySQLi getExporter()

Gets an exporter class object.

Returns:
An exporter object.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 281

getImporter

public JDatabaseImporterMySQLi getImporter()

Gets an importer class object.

Returns:
An importer object.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 303

getNumRows

public integer getNumRows(resource cursor)

Get the number of returned rows for the previous executed SQL statement.

Parameters:
cursor - An optional database cursor resource to extract the row count from.
Returns:
The number of returned rows.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 318

getQuery

public mixed getQuery(boolean new)

Get the current or query, or new JDatabaseQuery object.

Parameters:
new - False to return the last query set, True to return a new JDatabaseQuery object.
Returns:
The current value of the internal SQL variable or a new JDatabaseQuery object.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 342

getTableCreate

public array getTableCreate(mixed tables)

Shows the table CREATE statement that creates the given tables.

Parameters:
tables - A table name or a list of table names.
Returns:
A list of the create SQL for the tables.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 373

getTableColumns

public array getTableColumns(string table, bool typeOnly, mixed tables)

Retrieves field information about a given table.

Parameters:
table - The name of the database table.
typeOnly - True to only return field types.
Returns:
An array of fields for the database table.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 410

getTableKeys

public array getTableKeys(string table, mixed tables)

Get the details list of keys for a table.

Parameters:
table - The name of the table.
Returns:
An arry of the column specification for the table.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 429

getTableList

public array getTableList()

Method to get an array of all tables in the database.

Returns:
An array of all the tables in the database.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 445

getVersion

public string getVersion()

Get the version of the database connector.

Returns:
The database connector version.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 457

hasUTF

public boolean hasUTF()

Determines if the database engine supports UTF-8 character encoding.

Returns:
True if supported.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 470

insertid

public integer insertid()

Method to get the auto-incremented value from the last INSERT statement.

Returns:
The value of the auto-increment field from the last inserted row.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 483

query

public mixed query()

Execute the SQL statement.

Returns:
A database cursor resource on success, boolean false on failure.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 558

select

public boolean select(string database)

Select a database for use.

Parameters:
database - The name of the database to select for use.
Returns:
True if the database was successfully selected.
Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 588

setUTF

public bool setUTF()

Set the connection to use UTF-8 character encoding.

Returns:
True on success.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 601

transactionCommit

public void transactionCommit()

Method to commit a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 615

transactionRollback

public void transactionRollback()

Method to roll back a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 629

transactionStart

public void transactionStart()

Method to initialize a transaction.

Since:
11.1
Throws:
DatabaseException

libraries/joomla/database/database/mysqli.php at line 644

fetchArray

protected mixed fetchArray(mixed cursor)

Method to fetch a row from the result set cursor as an array.

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 658

fetchAssoc

protected mixed fetchAssoc(mixed cursor)

Method to fetch a row from the result set cursor as an associative array.

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 673

fetchObject

protected mixed fetchObject(mixed cursor, string class)

Method to fetch a row from the result set cursor as an object.

Parameters:
cursor - The optional result set cursor from which to fetch the row.
class - The class name to use for the returned row object.
Returns:
Either the next row from the result set or false if there are no more rows.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 687

freeResult

protected void freeResult(mixed cursor)

Method to free up the memory used for the result set.

Parameters:
cursor - The optional result set cursor from which to fetch the row.
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 700

explain

public string explain()

Diagnostic method to return explain information for a query.

Returns:
The explain output.
Deprecated:
12.1
Since:
11.1

libraries/joomla/database/database/mysqli.php at line 757

queryBatch

public mixed queryBatch(bool abortOnError, bool transactionSafe)

Execute a query batch.

Returns:
A database resource if successful, false if not.
Deprecated:
12.1
Since:
11.1

Документация по Joomla 1.7