Class DibiMySqliDriver
The dibi driver for MySQL database via improved extension.
Driver options:
- host => the MySQL server host name
- port (int) => the port number to attempt to connect to the MySQL server
- socket => the socket or named pipe
- username (or user)
- password (or pass)
- database => the database name to select
- options (array) => array of driver specific constants (MYSQLI_*) and values {@see mysqli_options}
- flags (int) => driver specific constants (MYSQLI_CLIENT_*) {@see mysqli_real_connect}
- charset => character encoding to set (default is utf8)
- persistent (bool) => try to find a persistent link?
- unbuffered (bool) => sends query without fetching and buffering the result rows automatically?
- sqlmode => see http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html
- resource (mysqli) => existing connection resource
- lazy, profiler, result, substitutes, ... => see DibiConnection options
DibiObject | --DibiMySqliDriver
Implements interfaces:
| Constructor Summary | |
|---|---|
| public |
__construct
()
|
| Method Summary | |
|---|---|
| void |
applyLimit
(string &$sql, int $limit, int $offset)
Injects LIMIT/OFFSET to the SQL query.
|
| void |
begin
([string $savepoint =
NULL])
Begins a transaction (if supported).
|
| void |
commit
([string $savepoint =
NULL])
Commits statements in a transaction.
|
| void |
connect
(&$config)
Connects to a database.
|
| void |
disconnect
()
Disconnects from a database.
|
| string |
escape
(mixed $value, string $type)
Encodes data for use in a SQL statement.
|
| string |
escapeLike
(string $value, int $pos)
Encodes string for use in a LIKE statement.
|
| array |
fetch
(bool $assoc)
Fetches the row at current position and moves the internal cursor to the next position.
|
| void |
free
()
Frees the resources allocated for this result set.
|
| int|FALSE |
Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
|
| array |
getInfo
()
Retrieves information about the most recently executed query.
|
| int|FALSE |
getInsertId
($sequence)
Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
|
| IDibiReflector |
getReflector
()
Returns the connection reflector.
|
| mysqli |
getResource
()
Returns the connection resource.
|
| array |
Returns metadata for all columns in a result set.
|
| mysqli_result |
Returns the result set resource.
|
| int |
getRowCount
()
Returns the number of rows in a result set.
|
| IDibiResultDriver|NULL |
query
(string $sql)
Executes the SQL query.
|
| void |
rollback
([string $savepoint =
NULL])
Rollback changes in a transaction.
|
| boolean |
seek
(int $row)
Moves cursor position without fetching row.
|
| string |
unescape
(string $value, string $type)
Decodes data from result set.
|
| Constant Summary | |||
|---|---|---|---|
| int | ERROR_ACCESS_DENIED |
1045 |
line 41 |
| int | ERROR_DATA_TRUNCATED |
1265 |
line 43 |
| int | ERROR_DUPLICATE_ENTRY |
1062 |
line 42 |
| Constructor Details | ||
|---|---|---|
|
line 59 __constructpublic __construct () |
||
| Method Details | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 348 applyLimitpublic void applyLimit (string &$sql, int $limit, int $offset) Injects LIMIT/OFFSET to the SQL query.
|
|||||||||||||||||||||
|
line 216 beginpublic void begin ([string $savepoint = Begins a transaction (if supported).
|
|||||||||||||||||||||
|
line 229 commitpublic void commit ([string $savepoint = Commits statements in a transaction.
|
|||||||||||||||||||||
|
line 73 connectpublic void connect (&$config) Connects to a database.
|
|||||||||||||||||||||
|
line 144 disconnectpublic void disconnect () Disconnects from a database.
|
|||||||||||||||||||||
|
line 282 escapepublic string escape (mixed $value, string $type) Encodes data for use in a SQL statement.
|
|||||||||||||||||||||
|
line 316 escapeLikepublic string escapeLike (string $value, int $pos) Encodes string for use in a LIKE statement.
|
|||||||||||||||||||||
|
line 382 fetchpublic array fetch (bool $assoc) Fetches the row at current position and moves the internal cursor to the next position.
|
|||||||||||||||||||||
|
line 409 freepublic void free () Frees the resources allocated for this result set.
|
|||||||||||||||||||||
|
line 192 getAffectedRowspublic int|FALSE getAffectedRows () Gets the number of affected rows by the last INSERT, UPDATE or DELETE query.
|
|||||||||||||||||||||
|
line 174 getInfopublic array getInfo () Retrieves information about the most recently executed query.
|
|||||||||||||||||||||
|
line 203 getInsertIdpublic int|FALSE getInsertId ($sequence) Retrieves the ID generated for an AUTO_INCREMENT column by the previous INSERT query.
|
|||||||||||||||||||||
|
line 264 getReflectorpublic IDibiReflector getReflector () Returns the connection reflector.
|
|||||||||||||||||||||
|
line 253 getResourcepublic mysqli getResource () Returns the connection resource.
|
|||||||||||||||||||||
|
line 421 getResultColumnspublic array getResultColumns () Returns metadata for all columns in a result set.
|
|||||||||||||||||||||
|
line 455 getResultResourcepublic mysqli_result getResultResource () Returns the result set resource.
|
|||||||||||||||||||||
|
line 367 getRowCountpublic int getRowCount () Returns the number of rows in a result set.
|
|||||||||||||||||||||
|
line 157 querypublic IDibiResultDriver|NULL query (string $sql) Executes the SQL query.
|
|||||||||||||||||||||
|
line 242 rollbackpublic void rollback ([string $savepoint = Rollback changes in a transaction.
|
|||||||||||||||||||||
|
line 395 seekpublic boolean seek (int $row) Moves cursor position without fetching row.
|
|||||||||||||||||||||
|
line 331 unescapepublic string unescape (string $value, string $type) Decodes data from result set.
|
|||||||||||||||||||||