class DbiMysqli implements DbiExtension

Interface to the MySQL Improved extension (MySQLi)

Methods

mixed
connect(string $user, string $password, array $server)

connects to the database server

boolean
selectDb(string $databaseName, mysqli $mysqli)

selects given database

mixed
realQuery(string $query, mysqli $mysqli, int $options)

runs a query and returns the result

array|bool
realMultiQuery(mysqli $mysqli, string $query)

Run the multi query and output the results

array
fetchArray(object $result)

returns array of rows with associative and numeric keys from $result

array
fetchAssoc(object $result)

returns array of rows with associative keys from $result

array
fetchRow(object $result)

returns array of rows with numeric keys from $result

bool
dataSeek(object $result, integer $offset)

Adjusts the result pointer to an arbitrary row in the result

void
freeResult(object $result)

Frees memory associated with the result

bool
moreResults(mysqli $mysqli)

Check if there are any more query results from a multi query

bool
nextResult(mysqli $mysqli)

Prepare next result from multi_query

mixed
storeResult(mysqli $mysqli)

Store the result returned from multi query

string
getHostInfo(mysqli $mysqli)

Returns a string representing the type of connection used

integer
getProtoInfo(mysqli $mysqli)

Returns the version of the MySQL protocol used

string
getClientInfo(mysqli $mysqli)

returns a string that represents the client library version

string|bool
getError(mysqli $mysqli)

returns last error message or false if no errors occurred

string|int
numRows(object $result)

returns the number of rows returned by last query

int
affectedRows(mysqli $mysqli)

returns the number of rows affected by last query

array
getFieldsMeta(object $result)

returns meta info for fields in $result

int
numFields(object $result)

return number of fields in given $result

int|bool
fieldLen(object $result, int $i)

returns the length of the given field $i in $result

string
fieldName(object $result, int $i)

returns name of $i. field in $result

string
fieldFlags(object $result, int $i)

returns concatenated string of human readable field flags

string
escapeString(mysqli $mysqli, string $string)

returns properly escaped string for use in MySQL queries

Details

at line 54
mixed connect(string $user, string $password, array $server)

connects to the database server

Parameters

string $user user name
string $password user password
array $server host/port/socket/persistent

Return Value

mixed false on error or a connection object on success

at line 159
boolean selectDb(string $databaseName, mysqli $mysqli)

selects given database

Parameters

string $databaseName database name to select
mysqli $mysqli the mysqli object

Return Value

boolean

at line 173
mixed realQuery(string $query, mysqli $mysqli, int $options)

runs a query and returns the result

Parameters

string $query query to execute
mysqli $mysqli mysqli object
int $options query options

Return Value

mixed result

at line 194
array|bool realMultiQuery(mysqli $mysqli, string $query)

Run the multi query and output the results

Parameters

mysqli $mysqli mysqli object
string $query multi query statement to execute

Return Value

array|bool

at line 206
array fetchArray(object $result)

returns array of rows with associative and numeric keys from $result

Parameters

object $result result set identifier

Return Value

array

at line 221
array fetchAssoc(object $result)

returns array of rows with associative keys from $result

Parameters

object $result result set identifier

Return Value

array

at line 236
array fetchRow(object $result)

returns array of rows with numeric keys from $result

Parameters

object $result result set identifier

Return Value

array

at line 252
bool dataSeek(object $result, integer $offset)

Adjusts the result pointer to an arbitrary row in the result

Parameters

object $result database result
integer $offset offset to seek

Return Value

bool true on success, false on failure

at line 264
void freeResult(object $result)

Frees memory associated with the result

Parameters

object $result database result

Return Value

void

at line 278
bool moreResults(mysqli $mysqli)

Check if there are any more query results from a multi query

Parameters

mysqli $mysqli the mysqli object

Return Value

bool true or false

at line 290
bool nextResult(mysqli $mysqli)

Prepare next result from multi_query

Parameters

mysqli $mysqli the mysqli object

Return Value

bool true or false

at line 302
mixed storeResult(mysqli $mysqli)

Store the result returned from multi query

Parameters

mysqli $mysqli the mysqli object

Return Value

mixed false when empty results / result set when not empty

at line 314
string getHostInfo(mysqli $mysqli)

Returns a string representing the type of connection used

Parameters

mysqli $mysqli mysql link

Return Value

string type of connection used

at line 326
integer getProtoInfo(mysqli $mysqli)

Returns the version of the MySQL protocol used

Parameters

mysqli $mysqli mysql link

Return Value

integer version of the MySQL protocol used

at line 338
string getClientInfo(mysqli $mysqli)

returns a string that represents the client library version

Parameters

mysqli $mysqli mysql link

Return Value

string MySQL client library version

at line 350
string|bool getError(mysqli $mysqli)

returns last error message or false if no errors occurred

Parameters

mysqli $mysqli mysql link

Return Value

string|bool error or false

at line 379
string|int numRows(object $result)

returns the number of rows returned by last query

Parameters

object $result result set identifier

Return Value

string|int

at line 396
int affectedRows(mysqli $mysqli)

returns the number of rows affected by last query

Parameters

mysqli $mysqli the mysqli object

Return Value

int

at line 408
array getFieldsMeta(object $result)

returns meta info for fields in $result

Parameters

object $result result set identifier

Return Value

array meta info for fields in $result

at line 491
int numFields(object $result)

return number of fields in given $result

Parameters

object $result result set identifier

Return Value

int field count

at line 504
int|bool fieldLen(object $result, int $i)

returns the length of the given field $i in $result

Parameters

object $result result set identifier
int $i field

Return Value

int|bool length of field

at line 525
string fieldName(object $result, int $i)

returns name of $i. field in $result

Parameters

object $result result set identifier
int $i field

Return Value

string name of $i. field in $result

at line 546
string fieldFlags(object $result, int $i)

returns concatenated string of human readable field flags

Parameters

object $result result set identifier
int $i field

Return Value

string field flags

at line 590
string escapeString(mysqli $mysqli, string $string)

returns properly escaped string for use in MySQL queries

Parameters

mysqli $mysqli database link
string $string string to be escaped

Return Value

string a MySQL escaped string