Index: Zend/Db/Adapter/Pdo/Abstract.php =================================================================== --- Zend/Db/Adapter/Pdo/Abstract.php (revision 788) +++ Zend/Db/Adapter/Pdo/Abstract.php (revision 790) @@ -196,5 +196,24 @@ } } + /** + * Returns the type constant for a variable. + * + * @param string $value + * @return integer + */ + protected function _getType($value) + { + if (is_bool($value)) { + $type = PDO::PARAM_BOOL; + } else if (is_null($value)) { + $type = PDO::PARAM_NULL; + } else if (is_integer($value)) { + $type = PDO::PARAM_INT; + } else { + $type = PDO::PARAM_STR; + } + return $type; + } } Index: Zend/Db/Adapter/Abstract.php =================================================================== --- Zend/Db/Adapter/Abstract.php (revision 788) +++ Zend/Db/Adapter/Abstract.php (revision 790) @@ -153,7 +153,22 @@ // prepare and execute the statement with profiling $stmt = $this->prepare($sql); $q = $this->_profiler->queryStart($sql); - $stmt->execute((array) $bind); + if (is_array($bind)) { + $paramIndex = 1; + foreach ($bind as $col => $value) { + if (is_integer($col)) { + $parameter = $paramIndex; + } else if ($col[0] != ':') { + $parameter = ':' . $col; + } else { + $parameter = $col; + } + $type = $this->_getType($value); + $stmt->bindValue($parameter, $value, $type); + $paramIndex++; + } + } + $stmt->execute(); $this->_profiler->queryEnd($q); // return the results embedded in the prepared statement object @@ -543,4 +558,12 @@ * @return string */ abstract public function limit($sql, $count, $offset); + + /** + * Returns the type constant for a variable. + * + * @param string $value + * @return integer + */ + abstract protected function _getType($value); } Index: Zend/Db/Adapter/Oracle.php =================================================================== --- Zend/Db/Adapter/Oracle.php (revision 788) +++ Zend/Db/Adapter/Oracle.php (revision 790) @@ -319,6 +319,22 @@ public function _getExecuteMode() { return $this->_execute_mode; } + + /** + * Returns the type constant for a variable. + * + * @param string $value + * @return integer + */ + protected function _getType($value) + { + if (is_integer($value)) { + $type = SQLT_INT; + } else { + $type = SQLT_CHR; + } + return $type; + } } Index: Zend/Db/Adapter/Db2.php =================================================================== --- Zend/Db/Adapter/Db2.php (revision 788) +++ Zend/Db/Adapter/Db2.php (revision 790) @@ -520,4 +520,20 @@ } return $data; } + + /** + * Returns the type constant for a variable. + * + * @param string $value + * @return integer + */ + protected function _getType($value) + { + if (is_integer($value)) { + $type = DB2_LONG; + } else { + $type = DB2_CHAR; + } + return $type; + } }