Db/Statement.php
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.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Db
- Subpackage
- Statement
- Version
- $Id: Statement.php 24790 2012-05-10 12:28:51Z mcleod@spaceweb.nl $
Package: Zend\Db\StatementAbstract class to emulate a PDOStatement for native database adapters.
- Implements
- \Zend_Db_Statement_Interface
- Children
- \Zend_Db_Statement_Oracle
- \Zend_Db_Statement_Mysqli
- \Zend_Db_Statement_Pdo
- \Zend_Db_Statement_Sqlsrv
- \Zend_Db_Statement_Db2
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties



array $_bindParam = array()
Query parameter bindings; covers bindParam() and bindValue().
Default valuearray()
Details- Type
- array



array $_sqlParam = array()
Parameter placeholders in the SQL string by position in the split array.
Default valuearray()
Details- Type
- array



array $_sqlSplit = array()
SQL string split into an array at placeholders.
Default valuearray()
Details- Type
- array



resource|object $_stmt = null
The driver level statement object/resource
Default valuenull
Details- Type
- resource | object
Methods



_fetchBound(array $row) : bool
Helper function to map retrieved row
to bound column variables
ParametersName | Type | Description |
---|
$row | array | |
---|
Returns 


_stripQuoted(string $sql) : string
Remove parts of a SQL string that contain quoted strings
of values or identifiers.
ParametersName | Type | Description |
---|
$sql | string | |
---|
Returns 


bindColumn(string $column, mixed $param, mixed $type = null) : bool
Bind a column of the statement result set to a PHP variable.
ParametersName | Type | Description |
---|
$column | string | Name the column in the result set, either by
position or by name. |
---|
$param | mixed | Reference to the PHP variable containing the value. |
---|
$type | mixed | OPTIONAL |
---|
ReturnsThrows 


bindParam(mixed $parameter, mixed $variable, mixed $type = null, mixed $length = null, mixed $options = null) : bool
Binds a parameter to the specified variable name.
ParametersName | Type | Description |
---|
$parameter | mixed | Name the parameter, either integer or string. |
---|
$variable | mixed | Reference to PHP variable containing the value. |
---|
$type | mixed | OPTIONAL Datatype of SQL parameter. |
---|
$length | mixed | OPTIONAL Length of SQL parameter. |
---|
$options | mixed | OPTIONAL Other options. |
---|
ReturnsThrows 


bindValue(mixed $parameter, mixed $value, mixed $type = null) : bool
Binds a value to a parameter.
ParametersName | Type | Description |
---|
$parameter | mixed | Name the parameter, either integer or string. |
---|
$value | mixed | Scalar value to bind to the parameter. |
---|
$type | mixed | OPTIONAL Datatype of the parameter. |
---|
ReturnsThrows 


execute(array $params = null) : bool
Executes a prepared statement.
ParametersName | Type | Description |
---|
$params | array | OPTIONAL Values to bind to parameter placeholders. |
---|
ReturnsThrows 


fetch(int $style = null, int $cursor = null, int $offset = null) : mixed
ParametersName | Type | Description |
---|
$style | int | OPTIONAL Fetch mode for this fetch operation. |
---|
$cursor | int | OPTIONAL Absolute, relative, or other. |
---|
$offset | int | OPTIONAL Number for absolute or relative cursors. |
---|
ReturnsType | Description |
---|
mixed | Array, object, or scalar depending on fetch mode. |
Throws 


fetchAll(int $style = null, int $col = null) : array
Returns an array containing all of the result set rows.
ParametersName | Type | Description |
---|
$style | int | OPTIONAL Fetch mode. |
---|
$col | int | OPTIONAL Column number, if fetch mode is by column. |
---|
ReturnsType | Description |
---|
array | Collection of rows, each in a format by the fetch mode. |
Throws 


fetchColumn(int $col = 0) : string
Returns a single column from the next row of a result set.
ParametersName | Type | Description |
---|
$col | int | OPTIONAL Position of the column to fetch. |
---|
ReturnsType | Description |
---|
string | One value from the next row of result set, or false. |
Throws 


fetchObject(string $class = 'stdClass', array $config = array()) : mixed
Fetches the next row and returns it as an object.
ParametersName | Type | Description |
---|
$class | string | OPTIONAL Name of the class to create. |
---|
$config | array | OPTIONAL Constructor arguments for the class. |
---|
ReturnsType | Description |
---|
mixed | One object instance of the specified class, or false. |
Throws 


getAttribute(string $key) : mixed
Retrieve a statement attribute.
ParametersName | Type | Description |
---|
$key | string | Attribute name. |
---|
ReturnsType | Description |
---|
mixed | Attribute value. |
Throws 


getDriverStatement() : \unknown_type
Gets the resource or object setup by the
_parse
ReturnsType | Description |
---|
\unknown_type | |



rowCount() : int
inheritedReturns the number of rows affected by the execution of the
last INSERT, DELETE, or UPDATE statement executed by this
statement object.
Inherited from:
\Zend_Db_Statement_Interface::rowCount() ReturnsType | Description |
---|
int | The number of rows affected. |
Throws 


setAttribute(string $key, mixed $val) : bool
Set a statement attribute.
ParametersName | Type | Description |
---|
$key | string | Attribute name. |
---|
$val | mixed | Attribute value. |
---|
ReturnsThrows 


setFetchMode(int $mode) : bool
Set the default fetch mode for this statement.
ParametersName | Type | Description |
---|
$mode | int | The fetch mode. |
---|
ReturnsThrows