class Connection extends PDOConnection implements Connection (View source)

Sqlsrv Connection implementation.

Methods

__construct(string $dsn, string|null $user = null, string|null $password = null, array $options = null)

No description

integer
exec(string $statement)

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

string
getServerVersion()

Returns the version number of the database server connected to.

prepare(string $prepareString, $driverOptions = array())

Prepares a statement for execution and returns a Statement object.

query()

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

string
quote($value, integer $type = \PDO::PARAM_STR)

Quotes a string for use in a query.

string
lastInsertId(string|null $name = null)

No description

boolean
requiresQueryForServerVersion()

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

Details

__construct(string $dsn, string|null $user = null, string|null $password = null, array $options = null)

Parameters

string $dsn
string|null $user
string|null $password
array $options

Exceptions

PDOException in case of an error.

integer exec(string $statement)

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

Parameters

string $statement

Return Value

integer

string getServerVersion()

Returns the version number of the database server connected to.

Return Value

string

Statement prepare(string $prepareString, $driverOptions = array())

Prepares a statement for execution and returns a Statement object.

Parameters

string $prepareString
$driverOptions

Return Value

Statement

Statement query()

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

Return Value

Statement

string quote($value, integer $type = \PDO::PARAM_STR)

Quotes a string for use in a query.

Parameters

$value
integer $type

Return Value

string

string lastInsertId(string|null $name = null)

Parameters

string|null $name

Return Value

string

boolean requiresQueryForServerVersion()

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

Return Value

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