SQLAnywhereConnection
in package
implements
Connection, ServerInfoAwareConnection
SAP Sybase SQL Anywhere implementation of the Connection interface.
Tags
Interfaces, Classes and Traits
- Connection
- Connection interface.
- ServerInfoAwareConnection
- Contract for a connection that is able to provide information about the server it is connected to.
Table of Contents
- $connection : resource
- __construct() : mixed
- Constructor.
- 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.
- getServerVersion() : string
- Returns the version number of the database server connected to.
- 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.
- requiresQueryForServerVersion() : bool
- Checks whether a query is required to retrieve the database server version.
- rollBack() : bool
- Rolls back the current transaction, as initiated by beginTransaction().
- endTransaction() : bool
- Ends transactional mode and enables auto commit again.
Properties
$connection
private
resource
$connection
The SQL Anywhere connection resource.
Methods
__construct()
Constructor.
public
__construct(string $dsn[, bool $persistent = false ]) : mixed
Connects to database with given connection string.
Parameters
- $dsn : string
-
The connection string.
- $persistent : bool = false
-
Whether or not to establish a persistent connection.
Tags
Return values
mixed —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.
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(mixed $statement) : int
Parameters
- $statement : mixed
Return values
int —getServerVersion()
Returns the version number of the database server connected to.
public
getServerVersion() : string
Return values
string —lastInsertId()
Returns the ID of the last inserted row or sequence value.
public
lastInsertId([mixed $name = null ]) : string
Parameters
- $name : mixed = null
Return values
string —prepare()
Prepares a statement for execution and returns a Statement object.
public
prepare(mixed $prepareString) : Statement
Parameters
- $prepareString : mixed
Return values
Statement —query()
Executes an SQL statement, returning a result set as a Statement object.
public
query() : Statement
Return values
Statement —quote()
Quotes a string for use in a query.
public
quote(mixed $input[, mixed $type = PDO::PARAM_STR ]) : string
Parameters
- $input : mixed
- $type : mixed = PDO::PARAM_STR
Return values
string —requiresQueryForServerVersion()
Checks whether a query is required to retrieve the database server version.
public
requiresQueryForServerVersion() : bool
Return values
bool —True if a query is required to retrieve the database server version, false otherwise.
rollBack()
Rolls back the current transaction, as initiated by beginTransaction().
public
rollBack() : bool
Tags
Return values
bool —TRUE on success or FALSE on failure.
endTransaction()
Ends transactional mode and enables auto commit again.
private
endTransaction() : bool
Tags
Return values
bool —Whether or not ending transactional mode succeeded.