API Documentation

Db/Statement/Pdo.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Db
subpackage
Statement
version
$Id: Pdo.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Db_Statement_Pdo

Description

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.

Zend_Db_Statement_Pdo

Extends from
Zend_Db_Statement
Implements
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Db
subpackage
Statement
Properties
$_fetchMode
Methods
_prepare
bindColumn
_bindParam
bindValue
closeCursor
columnCount
errorCode
errorInfo
_execute
fetch
getIterator
fetchAll
fetchColumn
fetchObject
getAttribute
getColumnMeta
nextRowset
rowCount
setAttribute
setFetchMode

Description

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.

Properties

$_fetchMode

int $_fetchMode = 'PDO'

Details

$_fetchMode
int
visibility
protected
default
PDO
final
false
static
false

Methods

_bindParam

_bindParam( mixed $parameter, mixed $variable, mixed $type = null, mixed $length = null, mixed $options = null ) : bool

Binds a parameter to the specified variable name.

Arguments
$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.
Output
bool
Details
visibility
protected
final
false
static
false
throws

_execute

_execute( array $params = null ) : bool

Executes a prepared statement.

Arguments
$params
array
OPTIONAL Values to bind to parameter placeholders.
Output
bool
Details
visibility
public
final
false
static
false
throws

_prepare

_prepare( string $sql ) : void

Prepare a string SQL statement and create a statement object.

Arguments
$sql
string
Details
visibility
protected
final
false
static
false
throws

bindColumn

bindColumn( string $column, mixed $param, mixed $type = null ) : bool

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

Arguments
$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
Output
bool
Details
visibility
public
final
false
static
false
throws

bindValue

bindValue( mixed $parameter, mixed $value, mixed $type = null ) : bool

Binds a value to a parameter.

Arguments
$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.
Output
bool
Details
visibility
public
final
false
static
false
throws

closeCursor

closeCursor( ) : bool

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

Output
bool
Details
visibility
public
final
false
static
false
throws

columnCount

columnCount( ) : int

Returns the number of columns in the result set.

Returns null if the statement has no result set metadata.

Output
int
The number of columns.
Details
visibility
public
final
false
static
false
throws

errorCode

errorCode( ) : string

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

Output
string
error code.
Details
visibility
public
final
false
static
false
throws

errorInfo

errorInfo( ) : array

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

Output
array
Details
visibility
public
final
false
static
false
throws

fetch

fetch( int $style = null, int $cursor = null, int $offset = null ) : mixed

Fetches a row from the result set.

Arguments
$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.
Output
mixed
Array, object, or scalar depending on fetch mode.
Details
visibility
public
final
false
static
false
throws

fetchAll

fetchAll( int $style = null, int $col = null ) : array

Returns an array containing all of the result set rows.

Arguments
$style
int
OPTIONAL Fetch mode.
$col
int
OPTIONAL Column number, if fetch mode is by column.
Output
array
Collection of rows, each in a format by the fetch mode.
Details
visibility
public
final
false
static
false
throws

fetchColumn

fetchColumn( int $col = 0 ) : string

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

Arguments
$col
int
OPTIONAL Position of the column to fetch.
Output
string
Details
visibility
public
final
false
static
false
throws

fetchObject

fetchObject( string $class = stdClass, array $config = array ) : mixed

Fetches the next row and returns it as an object.

Arguments
$class
string
OPTIONAL Name of the class to create.
$config
array
OPTIONAL Constructor arguments for the class.
Output
mixed
One object instance of the specified class.
Details
visibility
public
final
false
static
false
throws

getAttribute

getAttribute( integer $key ) : mixed

Retrieve a statement attribute.

Arguments
$key
integer
Attribute name.
Output
mixed
Attribute value.
Details
visibility
public
final
false
static
false
throws

getColumnMeta

getColumnMeta( int $column ) : mixed

Returns metadata for a column in a result set.

Arguments
$column
int
Output
mixed
Details
visibility
public
final
false
static
false
throws

getIterator

getIterator( ) : IteratorIterator

Required by IteratorAggregate interface

Output
IteratorIterator
Details
visibility
public
final
false
static
false

nextRowset

nextRowset( ) : bool

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.

Output
bool
Details
visibility
public
final
false
static
false
throws

rowCount

rowCount( ) : int

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

Output
int
The number of rows affected.
Details
visibility
public
final
false
static
false
throws

setAttribute

setAttribute( string $key, mixed $val ) : bool

Set a statement attribute.

Arguments
$key
string
Attribute name.
$val
mixed
Attribute value.
Output
bool
Details
visibility
public
final
false
static
false
throws

setFetchMode

setFetchMode( int $mode ) : bool

Set the default fetch mode for this statement.

Arguments
$mode
int
The fetch mode.
Output
bool
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.