Properties

$result

$result : resource

Database results

Type

resource

$connection

$connection : resource

Default database connection

Type

resource

$statement

$statement : mixed

Prepared statement

Type

mixed

$tables

$tables : array

Database tables

Type

array

$database

$database : string

Database

Type

string

$dsn

$dsn : string

PDO DSN

Type

string

$dbtype

$dbtype : string

PDO DB Type

Type

string

$placeholder

$placeholder : string

Statement placeholder

Type

string

Methods

getAvailableAdapters()

getAvailableAdapters() : array

Get the available database adapters

Returns

array

isAvailable()

isAvailable(string  $adapter) : boolean

Get the available image library adapters

Parameters

string $adapter

Returns

boolean

__construct()

__construct(array  $options) : \Pop\Db\Adapter\Pdo

Constructor

Instantiate the PDO database connection object.

Parameters

array $options

Throws

\Pop\Db\Adapter\Exception

Returns

\Pop\Db\Adapter\Pdo

showError()

showError(string  $code = null, array  $info = null) : void

Throw an exception upon a database error.

Parameters

string $code
array $info

Throws

\Pop\Db\Adapter\Exception

prepare()

prepare(string  $sql, array  $attribs = null) : \Pop\Db\Adapter\Pdo

Prepare a SQL query.

Parameters

string $sql
array $attribs

Returns

\Pop\Db\Adapter\Pdo

bindParams()

bindParams(array  $params) : \Pop\Db\Adapter\Pdo

Bind parameters to for a prepared SQL query.

Parameters

array $params

Returns

\Pop\Db\Adapter\Pdo

execute()

execute() : void

Execute the prepared SQL query.

Throws

\Pop\Db\Adapter\Exception

query()

query(string  $sql) : void

Execute the SQL query and create a result resource, or display the SQL error.

Parameters

string $sql

fetch()

fetch() : array

Return the results array from the results resource.

Throws

\Pop\Db\Adapter\Exception

Returns

array

escape()

escape(string  $value) : string

Return the escaped string value.

Parameters

string $value

Returns

string

lastId()

lastId() : integer

Return the auto-increment ID of the last query.

Returns

integer

numberOfRows()

numberOfRows() : integer

Return the number of rows in the result.

Throws

\Pop\Db\Adapter\Exception

Returns

integer

numberOfFields()

numberOfFields() : integer

Return the number of fields in the result.

Throws

\Pop\Db\Adapter\Exception

Returns

integer

hasResult()

hasResult() : boolean

Determine whether or not an result resource exists

Returns

boolean

getResult()

getResult() : resource

Get the result resource

Returns

resource

isConnected()

isConnected() : boolean

Determine whether or not connected

Returns

boolean

getConnection()

getConnection() : resource

Get the connection resource

Returns

resource

disconnect()

disconnect() : void

Close the DB connection.

getTables()

getTables() : array

Get an array of the tables of the database.

Returns

array

version()

version() : string

Return the database version.

Returns

string

isPdo()

isPdo() : boolean

Return if the adapter is a PDO adapter

Returns

boolean

isInstalled()

isInstalled(string  $type = null) : boolean

Check if PDO is installed.

Parameters

string $type

Returns

boolean

getDsn()

getDsn() : string

Get PDO DSN

Returns

string

getDbtype()

getDbtype() : string

Get PDO DB Type

Returns

string

fetchRow()

fetchRow() : mixed

Fetch and return a row.

Returns

mixed

fetchResult()

fetchResult() : array

Fetch and return the values.

Returns

array

loadTables()

loadTables() : array

Get an array of the tables of the database.

Returns

array