interface DbiExtension (View source)

Contract for every database extension supported by phpMyAdmin

Methods

Connection|null
connect(string $user, string $password, Server $server)

Connects to the database server.

bool
selectDb(string|DatabaseName $databaseName, Connection $connection)

selects given database

realQuery(string $query, Connection $connection, int $options)

runs a query and returns the result

bool
realMultiQuery(Connection $connection, string $query)

Run the multi query and output the results

bool
moreResults(Connection $connection)

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

bool
nextResult(Connection $connection)

Prepare next result from multi_query

storeResult(Connection $connection)

Store the result returned from multi query

string
getHostInfo(Connection $connection)

Returns a string representing the type of connection used

int
getProtoInfo(Connection $connection)

Returns the version of the MySQL protocol used

string
getClientInfo()

returns a string that represents the client library version

string
getError(Connection $connection)

Returns last error message or an empty string if no errors occurred.

int|string
affectedRows(Connection $connection)

returns the number of rows affected by last query

string
escapeString(Connection $connection, string $string)

returns properly escaped string for use in MySQL queries

Statement|null
prepare(Connection $connection, string $query)

Prepare an SQL statement for execution.

int
getWarningCount(Connection $connection)

Returns the number of warnings from the last query.

Details

Connection|null connect(string $user, string $password, Server $server)

Connects to the database server.

Parameters

string $user
string $password
Server $server

Return Value

Connection|null

bool selectDb(string|DatabaseName $databaseName, Connection $connection)

selects given database

Parameters

string|DatabaseName $databaseName

database name to select

Connection $connection

Return Value

bool

ResultInterface|false realQuery(string $query, Connection $connection, int $options)

runs a query and returns the result

Parameters

string $query

query to execute

Connection $connection
int $options

query options

Return Value

ResultInterface|false result

bool realMultiQuery(Connection $connection, string $query)

Run the multi query and output the results

Parameters

Connection $connection
string $query

multi query statement to execute

Return Value

bool

bool moreResults(Connection $connection)

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

Parameters

Connection $connection

Return Value

bool

bool nextResult(Connection $connection)

Prepare next result from multi_query

Parameters

Connection $connection

Return Value

bool

ResultInterface|false storeResult(Connection $connection)

Store the result returned from multi query

Parameters

Connection $connection

Return Value

ResultInterface|false

false when empty results / result set when not empty

string getHostInfo(Connection $connection)

Returns a string representing the type of connection used

Parameters

Connection $connection

Return Value

string

type of connection used

int getProtoInfo(Connection $connection)

Returns the version of the MySQL protocol used

Parameters

Connection $connection

Return Value

int

version of the MySQL protocol used

string getClientInfo()

returns a string that represents the client library version

Return Value

string

MySQL client library version

string getError(Connection $connection)

Returns last error message or an empty string if no errors occurred.

Parameters

Connection $connection

Return Value

string

int|string affectedRows(Connection $connection)

returns the number of rows affected by last query

Parameters

Connection $connection

Return Value

int|string

string escapeString(Connection $connection, string $string)

returns properly escaped string for use in MySQL queries

Parameters

Connection $connection
string $string

string to be escaped

Return Value

string

a MySQL escaped string

Statement|null prepare(Connection $connection, string $query)

Prepare an SQL statement for execution.

Parameters

Connection $connection
string $query

The query, as a string.

Return Value

Statement|null

int getWarningCount(Connection $connection)

Returns the number of warnings from the last query.

Parameters

Connection $connection

Return Value

int