Skip to content
PHP Ecosystem
Explore

DBLibPDO

API reference › yii › db › mssql › DBLibPDO

classyii\db\mssql\DBLibPDO
ExtendsPDO
Since2.0.41
Sourceframework/db/mssql/DBLibPDO.php

This is an extension of the default PDO class of DBLIB drivers.

It provides workarounds for improperly implemented functionalities of the DBLIB drivers.

MethodDescriptionDefined by
getAttribute()Retrieve a database connection attribute.DBLibPDO
lastInsertId()Returns value of the last inserted ID.DBLibPDO
public function getAttribute(int $attribute): mixed

Retrieve a database connection attribute.

It is necessary to override PDO’s method as some MSSQL PDO driver (for example, dblib) does not support getting attributes.

Parameters

ParameterTypeDescription
$attributeintOne of the PDO::ATTR_* constants.

Returns

mixed: A successful call returns the value of the requested PDO attribute. An unsuccessful call returns null.

public function lastInsertId(string|null $name = null): string|false

Returns value of the last inserted ID.

Parameters

ParameterTypeDescription
$namestring|nullThe sequence name. Defaults to null.

Returns

string|false: Last inserted ID value.