# phpDox - PDO

# \PDO

####

## Synopsis

class PDO {

- // methods
- public void __construct()
- public bool beginTransaction()
- public bool commit()
- public string errorCode()
- public array errorInfo()
- public int exec()
- public mixed getAttribute()
- public array getAvailableDrivers()
- public bool inTransaction()
- public string lastInsertId()
- public PDOStatement prepare()
- public PDOStatement query()
- public string quote()
- public bool rollBack()
- public bool setAttribute()

}

## Methods

#### public

- __construct() — Creates a PDO instance representing a connection to a database
- beginTransaction() — Initiates a transaction
- commit() — Commits a transaction
- errorCode() — Fetch the SQLSTATE associated with the last operation on the database handle
- errorInfo() — Fetch extended error information associated with the last operation on the database handle
- exec() — Execute an SQL statement and return the number of affected rows
- getAttribute() — Retrieve a database connection attribute
- getAvailableDrivers() — Return an array of available PDO drivers
- inTransaction() — Checks if inside a transaction
- lastInsertId() — Returns the ID of the last inserted row or sequence value
- prepare() — Prepares a statement for execution and returns a statement object
- query() — Executes an SQL statement, returning a result set as a PDOStatement object
- quote() — Quotes a string for use in a query
- rollBack() — Rolls back a transaction
- setAttribute() — Set an attribute