interface DbiExtension

Contract for every database extension supported by phpMyAdmin

Methods

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

connects to the database server

boolean
selectDb(string $dbname, resource $link)

selects given database

mixed
realQuery(string $query, resource $link, int $options)

runs a query and returns the result

array|bool
realMultiQuery(resource $link, 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(resource $link)

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

bool
nextResult(resource $link)

Prepare next result from multi_query

mixed
storeResult(resource $link)

Store the result returned from multi query

string
getHostInfo(resource $link)

Returns a string representing the type of connection used

integer
getProtoInfo(resource $link)

Returns the version of the MySQL protocol used

string
getClientInfo(resource $link)

returns a string that represents the client library version

string|bool
getError(resource $link)

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(resource $link)

returns the number of rows affected by last query

array
getFieldsMeta(object $result)

returns metainfo 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(mixed $link, string $str)

returns properly escaped string for use in MySQL queries

Details

at line 27
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 41
boolean selectDb(string $dbname, resource $link)

selects given database

Parameters

string $dbname database name to select
resource $link connection object

Return Value

boolean

at line 52
mixed realQuery(string $query, resource $link, int $options)

runs a query and returns the result

Parameters

string $query query to execute
resource $link connection object
int $options query options

Return Value

mixed result

at line 62
array|bool realMultiQuery(resource $link, string $query)

Run the multi query and output the results

Parameters

resource $link connection object
string $query multi query statement to execute

Return Value

array|bool

at line 71
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 80
array fetchAssoc(object $result)

returns array of rows with associative keys from $result

Parameters

object $result result set identifier

Return Value

array

at line 89
array fetchRow(object $result)

returns array of rows with numeric keys from $result

Parameters

object $result result set identifier

Return Value

array

at line 99
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 108
void freeResult(object $result)

Frees memory associated with the result

Parameters

object $result database result

Return Value

void

at line 117
bool moreResults(resource $link)

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

Parameters

resource $link the connection object

Return Value

bool true or false

at line 126
bool nextResult(resource $link)

Prepare next result from multi_query

Parameters

resource $link the connection object

Return Value

bool true or false

at line 135
mixed storeResult(resource $link)

Store the result returned from multi query

Parameters

resource $link mysql link

Return Value

mixed false when empty results / result set when not empty

at line 144
string getHostInfo(resource $link)

Returns a string representing the type of connection used

Parameters

resource $link mysql link

Return Value

string type of connection used

at line 153
integer getProtoInfo(resource $link)

Returns the version of the MySQL protocol used

Parameters

resource $link mysql link

Return Value

integer version of the MySQL protocol used

at line 162
string getClientInfo(resource $link)

returns a string that represents the client library version

Parameters

resource $link mysql link

Return Value

string MySQL client library version

at line 171
string|bool getError(resource $link)

returns last error message or false if no errors occurred

Parameters

resource $link connection link

Return Value

string|bool error or false

at line 180
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 189
int affectedRows(resource $link)

returns the number of rows affected by last query

Parameters

resource $link the connection object

Return Value

int

at line 198
array getFieldsMeta(object $result)

returns metainfo for fields in $result

Parameters

object $result result set identifier

Return Value

array meta info for fields in $result

at line 207
int numFields(object $result)

return number of fields in given $result

Parameters

object $result result set identifier

Return Value

int field count

at line 217
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 227
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 237
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 247
string escapeString(mixed $link, string $str)

returns properly escaped string for use in MySQL queries

Parameters

mixed $link database link
string $str string to be escaped

Return Value

string a MySQL escaped string