Overview

Packages

  • Auth
  • Config
  • Controller
  • Date
  • Db
  • Feed
    • Abstract
    • Writers
  • File
    • Decorator
  • Form
    • Element
  • Image
  • Log
    • Writer
  • Net
    • Exception
    • REST
  • None
  • PHP
  • PHPMailer
  • Session
  • Util
  • Validate
    • Validator
  • Zend
    • Db
      • Adapter
      • Expr
      • Profiler
      • Select
      • Statement
      • Table
    • Loader
      • Autoloader
      • PluginLoader
    • Registry

Classes

  • Zend_Db_Statement
  • Zend_Db_Statement_Db2
  • Zend_Db_Statement_Mysqli
  • Zend_Db_Statement_Oracle
  • Zend_Db_Statement_Pdo
  • Zend_Db_Statement_Pdo_Ibm
  • Zend_Db_Statement_Pdo_Oci
  • Zend_Db_Statement_Sqlsrv

Interfaces

  • Zend_Db_Statement_Interface

Exceptions

  • Zend_Db_Statement_Db2_Exception
  • Zend_Db_Statement_Exception
  • Zend_Db_Statement_Mysqli_Exception
  • Zend_Db_Statement_Oracle_Exception
  • Zend_Db_Statement_Sqlsrv_Exception
  • Overview
  • Package
  • Class
  • Tree

Class Zend_Db_Statement_Pdo

Proxy class to wrap a PDOStatement object. Matches the interface of PDOStatement. All methods simply proxy to the matching method in PDOStatement. PDOExceptions thrown by PDOStatement are re-thrown as Zend_Db_Statement_Exception.

Zend_Db_Statement implements Zend_Db_Statement_Interface
Extended by Zend_Db_Statement_Pdo implements IteratorAggregate

Direct known subclasses

Zend_Db_Statement_Pdo_Ibm, Zend_Db_Statement_Pdo_Oci
Package: Zend\Db\Statement
Category: Zend
Copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
License: New BSD License
Located at Zend/Db/Statement/Pdo.php
Methods summary
protected
# _prepare( string $sql )

Prepare a string SQL statement and create a statement object.

Prepare a string SQL statement and create a statement object.

Parameters

$sql
string

Throws

Zend_Db_Statement_Exception
public boolean
# bindColumn( string $column, mixed & $param, mixed $type = null )

Bind a column of the statement result set to a PHP variable.

Bind a column of the statement result set to a PHP variable.

Parameters

$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

Returns

boolean

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::bindColumn
protected boolean
# _bindParam( mixed $parameter, mixed & $variable, mixed $type = null, mixed $length = null, mixed $options = null )

Binds a parameter to the specified variable name.

Binds a parameter to the specified variable name.

Parameters

$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.

Returns

boolean

Throws

Zend_Db_Statement_Exception
public boolean
# bindValue( mixed $parameter, mixed $value, mixed $type = null )

Binds a value to a parameter.

Binds a value to a parameter.

Parameters

$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.

Returns

boolean

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::bindValue
public boolean
# closeCursor( )

Closes the cursor, allowing the statement to be executed again.

Closes the cursor, allowing the statement to be executed again.

Returns

boolean

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::closeCursor
public integer
# columnCount( )

Returns the number of columns in the result set. Returns null if the statement has no result set metadata.

Returns the number of columns in the result set. Returns null if the statement has no result set metadata.

Returns

integer
The number of columns.

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::columnCount
public string
# errorCode( )

Retrieves the error code, if any, associated with the last operation on the statement handle.

Retrieves the error code, if any, associated with the last operation on the statement handle.

Returns

string
error code.

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::errorCode
public array
# errorInfo( )

Retrieves an array of error information, if any, associated with the last operation on the statement handle.

Retrieves an array of error information, if any, associated with the last operation on the statement handle.

Returns

array

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::errorInfo
public boolean
# _execute( array $params = null )

Executes a prepared statement.

Executes a prepared statement.

Parameters

$params
array
OPTIONAL Values to bind to parameter placeholders.

Returns

boolean

Throws

Zend_Db_Statement_Exception
public mixed
# fetch( integer $style = null, integer $cursor = null, integer $offset = null )

Fetches a row from the result set.

Fetches a row from the result set.

Parameters

$style
integer
OPTIONAL Fetch mode for this fetch operation.
$cursor
integer
OPTIONAL Absolute, relative, or other.
$offset
integer
OPTIONAL Number for absolute or relative cursors.

Returns

mixed
Array, object, or scalar depending on fetch mode.

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::fetch
public IteratorIterator
# getIterator( )

Required by IteratorAggregate interface

Required by IteratorAggregate interface

Returns

IteratorIterator

Implementation of

IteratorAggregate::getIterator
public array
# fetchAll( integer $style = null, integer $col = null )

Returns an array containing all of the result set rows.

Returns an array containing all of the result set rows.

Parameters

$style
integer
OPTIONAL Fetch mode.
$col
integer
OPTIONAL Column number, if fetch mode is by column.

Returns

array
Collection of rows, each in a format by the fetch mode.

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::fetchAll
public string
# fetchColumn( integer $col = 0 )

Returns a single column from the next row of a result set.

Returns a single column from the next row of a result set.

Parameters

$col
integer
OPTIONAL Position of the column to fetch.

Returns

string

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::fetchColumn
public mixed
# fetchObject( string $class = 'stdClass', array $config = array() )

Fetches the next row and returns it as an object.

Fetches the next row and returns it as an object.

Parameters

$class
string
OPTIONAL Name of the class to create.
$config
array
OPTIONAL Constructor arguments for the class.

Returns

mixed
One object instance of the specified class.

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::fetchObject
public mixed
# getAttribute( integer $key )

Retrieve a statement attribute.

Retrieve a statement attribute.

Parameters

$key
integer
Attribute name.

Returns

mixed
Attribute value.

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::getAttribute
public mixed
# getColumnMeta( integer $column )

Returns metadata for a column in a result set.

Returns metadata for a column in a result set.

Parameters

$column
integer

Returns

mixed

Throws

Zend_Db_Statement_Exception
public boolean
# nextRowset( )

Retrieves the next rowset (result set) for a SQL statement that has multiple result sets. An example is a stored procedure that returns the results of multiple queries.

Retrieves the next rowset (result set) for a SQL statement that has multiple result sets. An example is a stored procedure that returns the results of multiple queries.

Returns

boolean

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::nextRowset
public integer
# rowCount( )

Returns the number of rows affected by the execution of the last INSERT, DELETE, or UPDATE statement executed by this statement object.

Returns the number of rows affected by the execution of the last INSERT, DELETE, or UPDATE statement executed by this statement object.

Returns

integer
The number of rows affected.

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::rowCount
public boolean
# setAttribute( string $key, mixed $val )

Set a statement attribute.

Set a statement attribute.

Parameters

$key
string
Attribute name.
$val
mixed
Attribute value.

Returns

boolean

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::setAttribute
public boolean
# setFetchMode( integer $mode )

Set the default fetch mode for this statement.

Set the default fetch mode for this statement.

Parameters

$mode
integer
The fetch mode.

Returns

boolean

Throws

Zend_Db_Statement_Exception

Implementation of

Zend_Db_Statement_Interface::setFetchMode
Methods inherited from Zend_Db_Statement
__construct(), _fetchBound(), _parseParameters(), _stripQuoted(), bindParam(), execute(), getAdapter(), getDriverStatement()
Properties summary
protected integer $_fetchMode PDO::FETCH_ASSOC
#
Properties inherited from Zend_Db_Statement
$_adapter, $_attribute, $_bindColumn, $_bindParam, $_queryId, $_sqlParam, $_sqlSplit, $_stmt
Pry Framework API documentation generated by ApiGen 2.6.1