# \Query\DriversPDOInterface

Interface describing the PDO class in PHP

## Summary

Methods
Constants
__construct()
beginTransaction()
commit()
errorCode()
errorInfo()
exec()
getAttribute()
getAvailableDrivers()
inTransaction()
lastInsertId()
prepare()
query()
quote()
rollBack()
setAttribute()
No constants found
No protected methods found
N/A
No private methods found
N/A

File
  Query/Drivers/PDOInterface.php
Package
  \Default

## Tags

None found

## Methods

### __construct()

    __construct(string  $dsn, string  $username, string  $password, array  $options = array())

Creates a PDO instance representing a connection to a database

#### Parameters

string | $dsn |
string | $username |
string | $password |
array | $options |

#### Throws

\PDOException

#

## Tags

None found

### beginTransaction()

    beginTransaction() : boolean

Initiates a transaction

#### Throws

\PDOException

#### Returns

boolean

#

## Tags

None found

### commit()

    commit() : boolean

Commits a transaction

#### Throws

\PDOException

#### Returns

boolean

#

## Tags

None found

### errorCode()

    errorCode() : mixed

Fetch the SQLSTATE associated with the last operation on the database handle

#### Returns

mixed

#

## Tags

None found

### errorInfo()

    errorInfo() : array

Fetch extended error information associated with the last operation on the database handle

#### Returns

array

#

## Tags

None found

### exec()

    exec(string  $statement) : integer

Execute an SQL statement and return the number of affected rows

#### Parameters

string | $statement |

#### Returns

integer

#

## Tags

None found

### getAttribute()

    getAttribute(integer  $attribute) : mixed

Retrieve a database connection attribute

#### Parameters

integer | $attribute |

#### Returns

mixed

#

## Tags

None found

### getAvailableDrivers()

    getAvailableDrivers() : array

Return an array of available PDO drivers

#### Returns

array

#

static

## Tags

None found

### inTransaction()

    inTransaction() : boolean

Checks if inside a transaction

#### Returns

boolean

#

## Tags

None found

### lastInsertId()

    lastInsertId(string  $name = NULL) : string

Returns teh ID of the last inserted row or sequence value

#### Parameters

string | $name | Name of the sequence object from which the ID should be returned

#### Returns

string

#

## Tags

None found

### prepare()

    prepare(string  $statement, array  $options = NULL) : \PDOStatement

Prepares a statement for execution and returns a statement object

#### Parameters

string | $statement |
array | $options |

#### Returns

\PDOStatement

#

## Tags

None found

### query()

    query() : \PDOStatement

Executes an SQL statement, returning a result set as a PDOStatement object

#### Returns

\PDOStatement

#

## Tags

None found

### quote()

    quote(string  $string, integer  $parameterType = \PDO::PARAM_STR) : string|false

Quotes a string for use in a query

#### Parameters

string | $string |
integer | $parameterType |

#### Returns

string|false

#

## Tags

None found

### rollBack()

    rollBack() : boolean

Rolls back a transaction

#### Throws

\PDOException

#### Returns

boolean

#

## Tags

None found

### setAttribute()

    setAttribute(integer  $attribute, mixed  $value) : boolean

Set an attribute

#### Parameters

integer | $attribute |
mixed | $value |

#### Returns

boolean

#

## Tags

None found

### PDOInterface.php