Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.73 KB

pdostatement-getattribute.md

File metadata and controls

38 lines (27 loc) · 1.73 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic
PDOStatement::getAttribute
API reference for the PDOStatement::getAttribute function in the Microsoft PDO_SQLSRV Driver for PHP for SQL Server.
David-Engel
davidengel
08/10/2020
sql
connectivity
reference

PDOStatement::getAttribute

[!INCLUDEDriver_PHP_Download]

Retrieves the value of a predefined PDOStatement attribute or custom driver attribute.

Syntax

  
mixed PDOStatement::getAttribute( $attribute );  

Parameters

$attribute: An integer, one of the PDO::ATTR_* or PDO::SQLSRV_ATTR_* constants. Supported attributes are the attributes you can set with PDOStatement::setAttribute, PDO::SQLSRV_ATTR_DIRECT_QUERY (for more information, see Direct Statement Execution and Prepared Statement Execution in the PDO_SQLSRV Driver), PDO::ATTR_CURSOR and PDO::SQLSRV_ATTR_CURSOR_SCROLL_TYPE (for more information, see Cursor Types (PDO_SQLSRV Driver)).

Return Value

On success, returns a (mixed) value for a predefined PDO attribute or custom driver attribute. Returns null on failure.

Remarks

See PDOStatement::setAttribute for a sample.

Support for PDO was added in version 2.0 of the [!INCLUDEssDriverPHP].

See Also

PDOStatement Class

PDO