Documentation

Connection

Connection interface.

Driver connections must implement this interface.

This resembles (a subset of) the PDO interface.

Tags
since
2.0

Table of Contents

beginTransaction()  : bool
Initiates a transaction.
commit()  : bool
Commits a transaction.
errorCode()  : string|null
Returns the error code associated with the last operation on the database handle.
errorInfo()  : array<string|int, mixed>
Returns extended error information associated with the last operation on the database handle.
exec()  : int
Executes an SQL statement and return the number of affected rows.
lastInsertId()  : string
Returns the ID of the last inserted row or sequence value.
prepare()  : Statement
Prepares a statement for execution and returns a Statement object.
query()  : Statement
Executes an SQL statement, returning a result set as a Statement object.
quote()  : string
Quotes a string for use in a query.
rollBack()  : bool
Rolls back the current transaction, as initiated by beginTransaction().

Methods

beginTransaction()

Initiates a transaction.

public beginTransaction() : bool
Return values
bool

TRUE on success or FALSE on failure.

commit()

Commits a transaction.

public commit() : bool
Return values
bool

TRUE on success or FALSE on failure.

errorCode()

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

public errorCode() : string|null
Return values
string|null

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

errorInfo()

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

public errorInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

exec()

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

public exec(string $statement) : int
Parameters
$statement : string
Return values
int

lastInsertId()

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

public lastInsertId([string|null $name = null ]) : string
Parameters
$name : string|null = null
Return values
string

prepare()

Prepares a statement for execution and returns a Statement object.

public prepare(string $prepareString) : Statement
Parameters
$prepareString : string
Return values
Statement

quote()

Quotes a string for use in a query.

public quote(string $input[, int $type = PDO::PARAM_STR ]) : string
Parameters
$input : string
$type : int = PDO::PARAM_STR
Return values
string

rollBack()

Rolls back the current transaction, as initiated by beginTransaction().

public rollBack() : bool
Return values
bool

TRUE on success or FALSE on failure.

Search results