class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection (View source)

PDO implementation of the Connection interface.

Used by all PDO-based drivers.

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 = [])

Prepares a statement for execution and returns a Statement object.

query()

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

mixed
quote(mixed $input, integer $type = \PDO::PARAM_STR)

Quotes a string for use in a query.

string
lastInsertId(string|null $name = null)

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

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 = [])

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

mixed quote(mixed $input, integer $type = \PDO::PARAM_STR)

Quotes a string for use in a query.

Parameters

mixed $input
integer $type

Return Value

mixed

string lastInsertId(string|null $name = null)

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

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.