Class Zend_Db_Statement_Pdo

Description

Implements interfaces:

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.

  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Db/Statement/Pdo.php (line 40)


	
			
Variable Summary
 PDOStatement $_stmt
Method Summary
 Zend_Db_Statement_Pdo __construct (Zend_Db_Adapter_Abstract $adapter, mixed $sql)
 bool bindColumn (string $column,  &$param, [mixed $type = null], mixed $param)
 bool bindParam (mixed $parameter,  &$variable, [mixed $type = null], [mixed $length = null], [mixed $options = null], mixed $variable)
 bool bindValue (mixed $parameter, mixed $value, [mixed $type = null])
 bool closeCursor ()
 int columnCount ()
 string errorCode ()
 array errorInfo ()
 bool execute ([ $params = array()])
 mixed fetch ([int $style = null], [int $cursor = null], [int $offset = null])
 array fetchAll ([int $style = null], [int $col = null])
 string fetchColumn ([int $col = 0])
 mixed fetchObject ([string $class = 'stdClass'], [ $config = array()])
 mixed getAttribute (string $key)
 mixed getColumnMeta (int $column)
 bool nextRowset ()
 int rowCount ()
 bool setAttribute (string $key, mixed $val)
 bool setFetchMode (int $mode)
 void _prepSql (string $sql)
Variables
int $_fetchMode = PDO::FETCH_ASSOC (line 53)
  • access: protected
PDOStatement $_stmt (line 48)

The mysqli_stmt object.

  • access: protected
Methods
Constructor __construct (line 61)

Constructor for a statement.

  • access: public
Zend_Db_Statement_Pdo __construct (Zend_Db_Adapter_Abstract $adapter, mixed $sql)
bindColumn (line 97)

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

  • throws: Zend_Db_Statement_Exception
  • access: public
bool bindColumn (string $column,  &$param, [mixed $type = null], mixed $param)
  • string $column: Name the column in the result set, either by position or by name.
  • mixed $param: Reference to the PHP variable containing the value.
  • mixed $type: OPTIONAL
  • &$param

Implementation of:
Zend_Db_Statement_Interface::bindColumn()
Bind a column of the statement result set to a PHP variable.
bindParam (line 118)

Binds a parameter to the specified variable name.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool bindParam (mixed $parameter,  &$variable, [mixed $type = null], [mixed $length = null], [mixed $options = null], mixed $variable)
  • mixed $parameter: Name the parameter, either integer or string.
  • mixed $variable: Reference to PHP variable containing the value.
  • mixed $type: OPTIONAL Datatype of SQL parameter.
  • mixed $length: OPTIONAL Length of SQL parameter.
  • mixed $options: OPTIONAL Other options.
  • &$variable

Implementation of:
Zend_Db_Statement_Interface::bindParam()
Binds a parameter to the specified variable name.
bindValue (line 140)

Binds a value to a parameter.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool bindValue (mixed $parameter, mixed $value, [mixed $type = null])
  • mixed $parameter: Name the parameter, either integer or string.
  • mixed $value: Scalar value to bind to the parameter.
  • mixed $type: OPTIONAL Datatype of the parameter.

Implementation of:
Zend_Db_Statement_Interface::bindValue()
Binds a value to a parameter.
closeCursor (line 156)

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

  • throws: Zend_Db_Statement_Exception
  • access: public
bool closeCursor ()

Implementation of:
Zend_Db_Statement_Interface::closeCursor()
Closes the cursor, allowing the statement to be executed again.
columnCount (line 173)

Returns the number of columns in the result set.

Returns null if the statement has no result set metadata.

  • return: The number of columns.
  • throws: Zend_Db_Statement_Exception
  • access: public
int columnCount ()

Implementation of:
Zend_Db_Statement_Interface::columnCount()
Returns the number of columns in the result set.
errorCode (line 190)

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

  • return: error code.
  • throws: Zend_Db_Statement_Exception
  • access: public
string errorCode ()

Implementation of:
Zend_Db_Statement_Interface::errorCode()
Retrieves the error code, if any, associated with the last operation on the statement handle.
errorInfo (line 207)

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

  • throws: Zend_Db_Statement_Exception
  • access: public
array errorInfo ()

Implementation of:
Zend_Db_Statement_Interface::errorInfo()
Retrieves an array of error information, if any, associated with the last operation on the statement handle.
execute (line 224)

Executes a prepared statement.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool execute ([ $params = array()])
  • array $params: OPTIONAL Values to bind to parameter placeholders.

Implementation of:
Zend_Db_Statement_Interface::execute()
Executes a prepared statement.
fetch (line 243)

Fetches a row from the result set.

  • return: Array, object, or scalar depending on fetch mode.
  • throws: Zend_Db_Statement_Exception
  • access: public
mixed fetch ([int $style = null], [int $cursor = null], [int $offset = null])
  • int $style: OPTIONAL Fetch mode for this fetch operation.
  • int $cursor: OPTIONAL Absolute, relative, or other.
  • int $offset: OPTIONAL Number for absolute or relative cursors.

Implementation of:
Zend_Db_Statement_Interface::fetch()
Fetches a row from the result set.
fetchAll (line 264)

Returns an array containing all of the result set rows.

  • return: Collection of rows, each in a format by the fetch mode.
  • throws: Zend_Db_Statement_Exception
  • access: public
array fetchAll ([int $style = null], [int $col = null])
  • int $style: OPTIONAL Fetch mode.
  • int $col: OPTIONAL Column number, if fetch mode is by column.

Implementation of:
Zend_Db_Statement_Interface::fetchAll()
Returns an array containing all of the result set rows.
fetchColumn (line 291)

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

  • throws: Zend_Db_Statement_Exception
  • access: public
string fetchColumn ([int $col = 0])
  • int $col: OPTIONAL Position of the column to fetch.

Implementation of:
Zend_Db_Statement_Interface::fetchColumn()
Returns a single column from the next row of a result set.
fetchObject (line 309)

Fetches the next row and returns it as an object.

  • return: One object instance of the specified class.
  • throws: Zend_Db_Statement_Exception
  • access: public
mixed fetchObject ([string $class = 'stdClass'], [ $config = array()])
  • string $class: OPTIONAL Name of the class to create.
  • array $config: OPTIONAL Constructor arguments for the class.

Implementation of:
Zend_Db_Statement_Interface::fetchObject()
Fetches the next row and returns it as an object.
getAttribute (line 326)

Retrieve a statement attribute.

  • return: Attribute value.
  • throws: Zend_Db_Statement_Exception
  • access: public
mixed getAttribute (string $key)
  • string $key: Attribute name.

Implementation of:
Zend_Db_Statement_Interface::getAttribute()
Retrieve a statement attribute.
getColumnMeta (line 343)

Returns metadata for a column in a result set.

  • throws: Zend_Db_Statement_Exception
  • access: public
mixed getColumnMeta (int $column)
  • int $column
nextRowset (line 361)

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.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool nextRowset ()

Implementation of:
Zend_Db_Statement_Interface::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.
rowCount (line 379)

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

  • return: The number of rows affected.
  • throws: Zend_Db_Statement_Exception
  • access: public
int rowCount ()

Implementation of:
Zend_Db_Statement_Interface::rowCount()
Returns the number of rows affected by the execution of the last INSERT, DELETE, or UPDATE statement executed by this statement object.
setAttribute (line 397)

Set a statement attribute.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool setAttribute (string $key, mixed $val)
  • string $key: Attribute name.
  • mixed $val: Attribute value.

Implementation of:
Zend_Db_Statement_Interface::setAttribute()
Set a statement attribute.
setFetchMode (line 414)

Set the default fetch mode for this statement.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool setFetchMode (int $mode)
  • int $mode: The fetch mode.

Implementation of:
Zend_Db_Statement_Interface::setFetchMode()
Set the default fetch mode for this statement.
_prepSql (line 77)

Prepare a string SQL statement and create a statement object.

  • throws: Zend_Db_Statement_Exception
  • access: protected
void _prepSql (string $sql)
  • string $sql

Documentation generated on Sun, 27 May 2007 23:26:33 -0700 by phpDocumentor 1.3.2