API Documentation

Db/Statement/Interface.php

Interfaces
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: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $
Interfaces
Zend_Db_Statement_Interface

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_Interface

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
Methods
bindColumn
bindParam
bindValue
closeCursor
columnCount
errorCode
errorInfo
execute
fetch
fetchAll
fetchColumn
fetchObject
getAttribute
nextRowset
rowCount
setAttribute
setFetchMode

Description

Emulates a PDOStatement for native database adapters.

Methods

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

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

execute

execute( array $params = array ) : 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

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( string $key ) : mixed

Retrieve a statement attribute.

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

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.