Index: library/Zend/Db/Statement/Pdo.php =================================================================== --- library/Zend/Db/Statement/Pdo.php (revision 11188) +++ library/Zend/Db/Statement/Pdo.php (working copy) @@ -114,6 +114,8 @@ $type = PDO::PARAM_NULL; } elseif (is_integer($variable)) { $type = PDO::PARAM_INT; + } elseif (is_resource($variable)) { + $type = PDO::PARAM_LOB; } else { $type = PDO::PARAM_STR; } Index: library/Zend/Db/Statement.php =================================================================== --- library/Zend/Db/Statement.php (revision 11188) +++ library/Zend/Db/Statement.php (working copy) @@ -277,10 +277,25 @@ public function execute(array $params = null) { /* + * Bind $params using bindParam() instead of _execute() since + * bindParam() sets the parameter types. + */ + if ($params !== null) { + $paramIndex = 1; + foreach ($params as $parameter => &$variable) { + if (is_int($parameter)) { + $parameter = $paramIndex; + } + $this->bindParam($parameter, $variable); + $paramIndex++; + } + } + + /* * Simple case - no query profiler to manage. */ if ($this->_queryId === null) { - return $this->_execute($params); + return $this->_execute(); } /* @@ -300,7 +315,7 @@ } $qp->start($this->_queryId); - $retval = $this->_execute($params); + $retval = $this->_execute(); $prof->queryEnd($this->_queryId);