Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Class for connecting to SQL databases and performing common operations using PDO.
string $_defaultStmtClass = 'Zend_Db_Statement_Pdo'
Default class name for a DB statement.
_beginTransaction(
)
:
Begin a transaction.
_commit(
)
:
Commit a transaction.
_connect(
)
:
void
Creates a PDO object and connects to the database.
_dsn(
)
:
string
Creates a PDO DSN for the adapter from $this->_config settings.
_quote(
string $value
)
:
string
Quote a raw string.
_rollBack(
)
:
Roll-back a transaction.
closeConnection(
)
:
void
Force the connection to close.
exec(
mixed $sql
)
:
integer
Executes an SQL statement and return the number of affected rows
getServerVersion(
)
:
string
Retrieve server version in PHP style
isConnected(
)
:
boolean
Test if a connection is active
lastInsertId(
string $tableName
=
null, string $primaryKey
=
null
)
:
string
Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
As a convention, on RDBMS brands that support sequences (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence from the arguments and returns the last id generated by that sequence. On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method returns the last value generated for such a column, and the table name argument is disregarded.
On RDBMS brands that don't support sequences, $tableName and $primaryKey are ignored.
prepare(
string $sql
)
:
PDOStatement
Prepares an SQL statement.
query(
string|Zend_Db_Select $sql, array $bind
=
array
)
:
Zend_Db_Statement_Pdo
Special handling for PDO query().
All bind parameter names must begin with ':'
setFetchMode(
int $mode
)
:
void
Set the PDO fetch mode.
supportsParameters(
string $type
)
:
bool
Check if the adapter supports real SQL parameters.