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.
Details_beginTransaction(
)
:
Begin a transaction.
Details_commit(
)
:
Commit a transaction.
Details_connect(
)
:
voidCreates a PDO object and connects to the database.
Details_dsn(
)
:
stringCreates a PDO DSN for the adapter from $this->_config settings.
Details_quote(
string $value
)
:
stringQuote a raw string.
Details_rollBack(
)
:
Roll-back a transaction.
DetailscloseConnection(
)
:
voidForce the connection to close.
Detailsexec(
mixed $sql
)
:
integerExecutes an SQL statement and return the number of affected rows
DetailsgetServerVersion(
)
:
stringRetrieve server version in PHP style
DetailsisConnected(
)
:
booleanTest if a connection is active
DetailslastInsertId(
string $tableName
=
null, string $primaryKey
=
null
)
:
stringGets 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.
Detailsprepare(
string $sql
)
:
PDOStatementPrepares an SQL statement.
Detailsquery(
string|Zend_Db_Select $sql, array $bind
=
array
)
:
Zend_Db_Statement_PdoSpecial handling for PDO query().
All bind parameter names must begin with ':'
DetailssetFetchMode(
int $mode
)
:
voidSet the PDO fetch mode.
DetailssupportsParameters(
string $type
)
:
boolCheck if the adapter supports real SQL parameters.
Details