\JDatabaseDriverMysqli
MySQLi database driver
Synopsis
class JDatabaseDriverMysqli
extends JDatabaseDriver
{
- // members
- public $name;
- protected $nameQuote;
- protected $nullDate;
- protected $dbMinimum;
- // Inherited members from JDatabaseDriver
- public $name;
- protected $connection;
- protected $count;
- protected $cursor;
- protected $debug;
- protected $limit;
- protected $log;
- protected $timings;
- protected $callStacks;
- protected $nameQuote;
- protected $nullDate;
- protected $offset;
- protected $options;
- protected $sql;
- protected $tablePrefix;
- protected $utf;
- protected $errorNum;
- protected $errorMsg;
- protected $instances;
- protected $dbMinimum;
- protected $transactionDepth;
- protected $disconnectHandlers;
- // methods
- public void __construct()
- public void __destruct()
- public void connect()
- public void disconnect()
- public string escape()
- public static boolean isSupported()
- public boolean connected()
- public JDatabaseDriverMysqli dropTable()
- public integer getAffectedRows()
- public mixed getCollation()
- public integer getNumRows()
- public array getTableCreate()
- public array getTableColumns()
- public array getTableKeys()
- public array getTableList()
- public string getVersion()
- public mixed insertid()
- public JDatabaseDriverMysqli lockTable()
- public mixed execute()
- public JDatabaseDriverMysqli renameTable()
- public boolean select()
- public boolean setUTF()
- public void transactionCommit()
- public void transactionRollback()
- public void transactionStart()
- protected mixed fetchArray()
- protected mixed fetchAssoc()
- protected mixed fetchObject()
- protected void freeResult()
- public JDatabaseDriverMysqli unlockTables()
- private boolean hasProfiling()
- // Inherited methods from JDatabaseDriver
- public static array getConnectors()
- public static JDatabaseDriver getInstance()
- public static array splitSql()
- public mixed __call()
- public void __construct()
- public string alterDbCharacterSet()
- public abstract void connect()
- public abstract boolean connected()
- public string createDatabase()
- public abstract void disconnect()
- public void addDisconnectHandler()
- public abstract JDatabaseDriver dropTable()
- public abstract string escape()
- protected abstract mixed fetchArray()
- protected abstract mixed fetchAssoc()
- protected abstract mixed fetchObject()
- protected abstract void freeResult()
- public abstract integer getAffectedRows()
- protected string getAlterDbCharacterSet()
- protected string getCreateDatabaseQuery()
- public abstract mixed getCollation()
- public resource getConnection()
- public integer getCount()
- protected string getDatabase()
- public string getDateFormat()
- public array getLog()
- public array getTimings()
- public array getCallStacks()
- public string getMinimum()
- public string getNullDate()
- public abstract integer getNumRows()
- public string getPrefix()
- public JDatabaseExporter getExporter()
- public JDatabaseImporter getImporter()
- public JDatabaseQuery getQuery()
- public JDatabaseIterator getIterator()
- public abstract array getTableColumns()
- public abstract array getTableCreate()
- public abstract array getTableKeys()
- public abstract array getTableList()
- public boolean getUTFSupport()
- public boolean hasUTFSupport()
- public abstract string getVersion()
- public abstract mixed insertid()
- public boolean insertObject()
- public boolean isMinimumVersion()
- public mixed loadAssoc()
- public mixed loadAssocList()
- public mixed loadColumn()
- public mixed loadNextObject()
- public mixed loadNextRow()
- public mixed loadObject()
- public mixed loadObjectList()
- public mixed loadResult()
- public mixed loadRow()
- public mixed loadRowList()
- public abstract JDatabaseDriver lockTable()
- public string quote()
- public mixed quoteName()
- protected string quoteNameStr()
- public string replacePrefix()
- public abstract JDatabaseDriver renameTable()
- public abstract boolean select()
- public boolean setDebug()
- public JDatabaseDriver setQuery()
- public abstract boolean setUTF()
- public abstract void transactionCommit()
- public abstract void transactionRollback()
- public abstract void transactionStart()
- public void truncateTable()
- public boolean updateObject()
- public abstract mixed execute()
- public abstract JDatabaseDriver unlockTables()
- // Inherited methods from JDatabase
- public mixed query()
- public static array getConnectors()
- public string getErrorMsg()
- public integer getErrorNum()
- public static JDatabaseDriver getInstance()
- public static array splitSql()
- public string stderr()
- public static boolean test()
Hierarchy
Members
protected
- $callStacks — array
- $connection — resource
- $count — integer
- $cursor — resource
- $dbMinimum — string
- $dbMinimum — string
- $debug — boolean
- $disconnectHandlers — array
- $errorMsg — string
- $errorNum — integer
- $instances — array
- $limit — integer
- $log — array
- $nameQuote
—
string
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. - $nameQuote — string
- $nullDate
—
string
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. - $nullDate — string
- $offset — integer
- $options — array
- $sql — mixed
- $tablePrefix — string
- $timings — array
- $transactionDepth — integer
- $utf — boolean
public
- $name
—
string
The name of the database driver. - $name
—
string
The name of the database driver.
Methods
private
- hasProfiling() — Internal function to check if profiling is available
protected
- fetchArray() — Method to fetch a row from the result set cursor as an array.
- fetchAssoc() — Method to fetch a row from the result set cursor as an associative array.
- fetchObject() — Method to fetch a row from the result set cursor as an object.
- freeResult() — Method to free up the memory used for the result set.
public
- __construct() — Constructor.
- __destruct() — Destructor.
- connect() — Connects to the database if needed.
- connected() — Determines if the connection to the server is active.
- disconnect() — Disconnects the database.
- dropTable() — Drops a table from the database.
- escape() — Method to escape a string for usage in an SQL statement.
- execute() — Execute the SQL statement.
- getAffectedRows() — Get the number of affected rows for the previous executed SQL statement.
- getCollation() — Method to get the database collation in use by sampling a text field of a table in the database.
- getNumRows() — Get the number of returned rows for the previous executed SQL statement.
- getTableColumns() — Retrieves field information about a given table.
- getTableCreate() — Shows the table CREATE statement that creates the given tables.
- getTableKeys() — Get the details list of keys for a table.
- getTableList() — Method to get an array of all tables in the database.
- getVersion() — Get the version of the database connector.
- insertid() — Method to get the auto-incremented value from the last INSERT statement.
- isSupported() — Test to see if the MySQL connector is available.
- lockTable() — Locks a table in the database.
- renameTable() — Renames a table in the database.
- select() — Select a database for use.
- setUTF() — Set the connection to use UTF-8 character encoding.
- transactionCommit() — Method to commit a transaction.
- transactionRollback() — Method to roll back a transaction.
- transactionStart() — Method to initialize a transaction.
- unlockTables() — Unlocks tables in the database.
Inherited from JDatabaseDriver
protected
- fetchArray() — Method to fetch a row from the result set cursor as an array.
- fetchAssoc() — Method to fetch a row from the result set cursor as an associative array.
- fetchObject() — Method to fetch a row from the result set cursor as an object.
- freeResult() — Method to free up the memory used for the result set.
- getAlterDbCharacterSet() — Return the query string to alter the database character set.
- getCreateDatabaseQuery() — Return the query string to create new Database.
- getDatabase() — Gets the name of the database used by this conneciton.
- quoteNameStr() — Quote strings coming from quoteName call.
public
- __call() — Magic method to provide method alias support for quote() and quoteName().
- addDisconnectHandler() — Adds a function callable just before disconnecting the database. Parameter of the callable is $this JDatabaseDriver
- alterDbCharacterSet() — Alter database's character set, obtaining query string from protected member.
- connect() — Connects to the database if needed.
- connected() — Determines if the connection to the server is active.
- createDatabase() — Create a new database using information from $options object, obtaining query string from protected member.
- disconnect() — Disconnects the database.
- dropTable() — Drops a table from the database.
- escape() — Escapes a string for usage in an SQL statement.
- execute() — Execute the SQL statement.
- getAffectedRows() — Get the number of affected rows for the previous executed SQL statement.
- getCallStacks() — Get the database driver SQL statement log.
- getCollation() — Method to get the database collation in use by sampling a text field of a table in the database.
- getConnection() — Method that provides access to the underlying database connection. Useful for when you need to call a proprietary method such as postgresql's lo_* methods.
- getConnectors() — Get a list of available database connectors. The list will only be populated with connectors that both the class exists and the static test method returns true. This gives us the ability to have a multitude of connector classes that are self-aware as to whether or not they are able to be used on a given system.
- getCount() — Get the total number of SQL statements executed by the database driver.
- getDateFormat() — Returns a PHP date() function compliant date format for the database driver.
- getExporter() — Gets an exporter class object.
- getImporter() — Gets an importer class object.
- getInstance() — Method to return a JDatabaseDriver instance based on the given options. There are three global options and then the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to be used for the connection. The 'select' option determines whether the connector should automatically select the chosen database.
- getIterator() — Get a new iterator on the current query.
- getLog() — Get the database driver SQL statement log.
- getMinimum() — Get the minimum supported database version.
- getNullDate() — Get the null or zero representation of a timestamp for the database driver.
- getNumRows() — Get the number of returned rows for the previous executed SQL statement.
- getPrefix() — Get the common table prefix for the database driver.
- getQuery() — Get the current query object or a new JDatabaseQuery object.
- getTableColumns() — Retrieves field information about the given tables.
- getTableCreate() — Shows the table CREATE statement that creates the given tables.
- getTableKeys() — Retrieves field information about the given tables.
- getTableList() — Method to get an array of all tables in the database.
- getTimings() — Get the database driver SQL statement log.
- getUTFSupport() — Determine whether or not the database engine supports UTF-8 character encoding.
- getVersion() — Get the version of the database connector
- hasUTFSupport() — Determine whether or not the database engine supports UTF-8 character encoding.
- insertObject() — Inserts a row into a table based on an object's properties.
- insertid() — Method to get the auto-incremented value from the last INSERT statement.
- isMinimumVersion() — Method to check whether the installed database version is supported by the database driver
- loadAssoc() — Method to get the first row of the result set from the database query as an associative array of ['field_name' => 'row_value'].
- loadAssocList() — Method to get an array of the result set rows from the database query where each row is an associative array of ['field_name' => 'row_value']. The array of rows can optionally be keyed by a field name, but defaults to a sequential numeric array.
- loadColumn() — Method to get an array of values from the <var>$offset</var> field in each row of the result set from the database query.
- loadNextObject() — Method to get the next row in the result set from the database query as an object.
- loadNextRow() — Method to get the next row in the result set from the database query as an array.
- loadObject() — Method to get the first row of the result set from the database query as an object.
- loadObjectList() — Method to get an array of the result set rows from the database query where each row is an object. The array of objects can optionally be keyed by a field name, but defaults to a sequential numeric array.
- loadResult() — Method to get the first field of the first row of the result set from the database query.
- loadRow() — Method to get the first row of the result set from the database query as an array. Columns are indexed numerically so the first column in the result set would be accessible via <var>$row[0]</var>, etc.
- loadRowList() — Method to get an array of the result set rows from the database query where each row is an array. The array of objects can optionally be keyed by a field offset, but defaults to a sequential numeric array.
- lockTable() — Locks a table in the database.
- quote() — Quotes and optionally escapes a string to database requirements for use in database queries.
- quoteName() — Wrap an SQL statement identifier name such as column, table or database names in quotes to prevent injection risks and reserved word conflicts.
- renameTable() — Renames a table in the database.
- replacePrefix() — This function replaces a string identifier <var>$prefix</var> with the string held is the <var>tablePrefix</var> class variable.
- select() — Select a database for use.
- setDebug() — Sets the database debugging state for the driver.
- setQuery() — Sets the SQL statement string for later execution.
- setUTF() — Set the connection to use UTF-8 character encoding.
- splitSql() — Splits a string of multiple queries into an array of individual queries.
- transactionCommit() — Method to commit a transaction.
- transactionRollback() — Method to roll back a transaction.
- transactionStart() — Method to initialize a transaction.
- truncateTable() — Method to truncate a table.
- unlockTables() — Unlocks tables in the database.
- updateObject() — Updates a row in a table based on an object's properties.
Inherited from JDatabase
public
- getConnectors() — Get a list of available database connectors. The list will only be populated with connectors that both the class exists and the static test method returns true. This gives us the ability to have a multitude of connector classes that are self-aware as to whether or not they are able to be used on a given system.
- getErrorMsg() — Gets the error message from the database connection.
- getErrorNum() — Gets the error number from the database connection.
- getInstance() — Method to return a JDatabaseDriver instance based on the given options. There are three global options and then the rest are specific to the database driver. The 'driver' option defines which JDatabaseDriver class is used for the connection -- the default is 'mysqli'. The 'database' option determines which database is to be used for the connection. The 'select' option determines whether the connector should automatically select the chosen database.
- query() — Execute the SQL statement.
- splitSql() — Splits a string of multiple queries into an array of individual queries.
- stderr() — Return the most recent error message for the database connector.
- test() — Test to see if the connector is available.