class MysqliException extends AbstractDriverException (View source)

Exception thrown in case the mysqli driver errors.

Methods

__construct(string $message, string|null $sqlState = null, int|string|null $errorCode = null)

Constructor.

int|string|null
getErrorCode()

Returns the driver specific error code if available.

string|null
getSQLState()

Returns the SQLSTATE the driver was in at the time the error occurred.

Details

__construct(string $message, string|null $sqlState = null, int|string|null $errorCode = null)

Constructor.

Parameters

string $message The driver error message.
string|null $sqlState The SQLSTATE the driver is in at the time the error occurred, if any.
int|string|null $errorCode The driver specific error code if any.

int|string|null getErrorCode()

Returns the driver specific error code if available.

Returns null if no driver specific error code is available for the error raised by the driver.

Return Value

int|string|null

string|null getSQLState()

Returns the SQLSTATE the driver was in at the time the error occurred.

Returns null if the driver does not provide a SQLSTATE for the error occurred.

Return Value

string|null