You need to execute a statement object if you create it using its
constructor, or if you want to execute the same statement multiple
times. Use the execute() method of the statement
object. The single argument is an array of value to bind to
parameter placeholders in the statement.
If you use positional parameters, or those that are marked with a question mark symbol ('?'), pass the bind values in a plain array.
Example 217. Executing a statement with positional parameters
<?php
$sql = 'SELECT * FROM bugs WHERE reported_by = ? AND bug_status = ?';
$stmt = new Zend_Db_Statement_Mysqli($db, $sql);
$stmt->execute(array('goofy', 'FIXED'));
If you use named parameters, or those that are indicated by a string identifier preceded by a colon character (':'), pass the bind values in an associative array. The keys of this array should match the parameter names.
Example 218. Executing a statement with named parameters
<?php
$sql = 'SELECT * FROM bugs WHERE ' .
'reported_by = :reporter AND bug_status = :status';
$stmt = new Zend_Db_Statement_Mysqli($db, $sql);
$stmt->execute(array(':reporter' => 'goofy', ':status' => 'FIXED'));
PDO statements support both positional parameters and named
parameters, but not both types in a single SQL statement. Some of
the Zend_Db_Statement classes for non-PDO extensions may support
only one type of parameter or the other.




