class MysqliConnection implements Connection, PingableConnection, ServerInfoAwareConnection (View source)

Constants

OPTION_FLAGS

Name of the option to set connection flags

Methods

__construct(array $params, string $username, string $password, array $driverOptions = [])

No description

mysqli
getWrappedResourceHandle()

Retrieves mysqli native resource handle.

string
getServerVersion()

Returns the version number of the database server connected to.

bool
requiresQueryForServerVersion()

Checks whether a query is required to retrieve the database server version.

prepare(string $prepareString)

Prepares a statement for execution and returns a Statement object.

query()

Executes an SQL statement, returning a result set as a Statement object.

mixed
quote(mixed $input, int $type = ParameterType::STRING)

Quotes a string for use in a query.

int
exec(string $statement)

Executes an SQL statement and return the number of affected rows.

string
lastInsertId(string|null $name = null)

Returns the ID of the last inserted row or sequence value.

bool
beginTransaction()

Initiates a transaction.

bool
commit()

Commits a transaction.

bool
rollBack()

{@inheritdoc}non-PHPdoc)

string|null
errorCode()

Returns the error code associated with the last operation on the database handle.

array
errorInfo()

Returns extended error information associated with the last operation on the database handle.

bool
ping()

Pings the server and re-connects when mysqli.reconnect = 1

Details

__construct(array $params, string $username, string $password, array $driverOptions = [])

Parameters

array $params
string $username
string $password
array $driverOptions

Exceptions

MysqliException

mysqli getWrappedResourceHandle()

Retrieves mysqli native resource handle.

Could be used if part of your application is not using DBAL.

Return Value

mysqli

string getServerVersion()

Returns the version number of the database server connected to.

Return Value

string

bool requiresQueryForServerVersion()

Checks whether a query is required to retrieve the database server version.

Return Value

bool True if a query is required to retrieve the database server version, false otherwise.

Statement prepare(string $prepareString)

Prepares a statement for execution and returns a Statement object.

Parameters

string $prepareString

Return Value

Statement

Statement query()

Executes an SQL statement, returning a result set as a Statement object.

Return Value

Statement

mixed quote(mixed $input, int $type = ParameterType::STRING)

Quotes a string for use in a query.

Parameters

mixed $input
int $type

Return Value

mixed

int exec(string $statement)

Executes an SQL statement and return the number of affected rows.

Parameters

string $statement

Return Value

int

string lastInsertId(string|null $name = null)

Returns the ID of the last inserted row or sequence value.

Parameters

string|null $name

Return Value

string

bool beginTransaction()

Initiates a transaction.

Return Value

bool TRUE on success or FALSE on failure.

bool commit()

Commits a transaction.

Return Value

bool TRUE on success or FALSE on failure.

bool rollBack()

{@inheritdoc}non-PHPdoc)

Return Value

bool TRUE on success or FALSE on failure.

string|null errorCode()

Returns the error code associated with the last operation on the database handle.

Return Value

string|null The error code, or null if no operation has been run on the database handle.

array errorInfo()

Returns extended error information associated with the last operation on the database handle.

Return Value

array

bool ping()

Pings the server and re-connects when mysqli.reconnect = 1

Return Value

bool