ServerInfoAwareConnection
extends
Connection
in
Contract for a connection that is able to provide information about the server it is connected to.
Tags
Table of Contents
Methods
- beginTransaction() : bool
- Initiates a transaction.
- commit() : bool
- Commits a transaction.
- exec() : int
- Executes an SQL statement and return the number of affected rows.
- getServerVersion() : string
- Returns information about the version of the database server connected to.
- lastInsertId() : string|int|false
- Returns the ID of the last inserted row or sequence value.
- prepare() : Statement
- Prepares a statement for execution and returns a Statement object.
- query() : Result
- Executes an SQL statement, returning a result set as a Statement object.
- quote() : mixed
- 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
Tags
Return values
bool —TRUE on success or FALSE on failure.
commit()
Commits a transaction.
public
commit() : bool
Tags
Return values
bool —TRUE on success or FALSE on failure.
exec()
Executes an SQL statement and return the number of affected rows.
public
exec(string $sql) : int
Parameters
- $sql : string
Tags
Return values
intgetServerVersion()
Returns information about the version of the database server connected to.
public
getServerVersion() : string
Tags
Return values
stringlastInsertId()
Returns the ID of the last inserted row or sequence value.
public
lastInsertId([string|null $name = null ]) : string|int|false
Parameters
- $name : string|null = null
Tags
Return values
string|int|falseprepare()
Prepares a statement for execution and returns a Statement object.
public
prepare(string $sql) : Statement
Parameters
- $sql : string
Tags
Return values
Statementquery()
Executes an SQL statement, returning a result set as a Statement object.
public
query(string $sql) : Result
Parameters
- $sql : string
Tags
Return values
Resultquote()
Quotes a string for use in a query.
public
quote(mixed $value[, int $type = ParameterType::STRING ]) : mixed
The usage of this method is discouraged. Use prepared statements or AbstractPlatform::quoteStringLiteral() instead.
Parameters
- $value : mixed
- $type : int = ParameterType::STRING
rollBack()
Rolls back the current transaction, as initiated by beginTransaction().
public
rollBack() : bool
Tags
Return values
bool —TRUE on success or FALSE on failure.