/** * Executes a prepared statement. * * @param array $params OPTIONAL Values to bind to parameter placeholders. * @return bool */ public function execute(array $params = null) { if ($this->_queryProfile) { if ($this->_queryProfile->hasEnded()) { $prof = $this->_adapter->getProfiler(); $q = $prof->queryClone($this->_queryProfile); $this->_queryProfile = $prof->getQueryProfile($q); } if ($params !== null) { foreach ($params as $param => $variable) { if (is_int($param)) { $param++; } $this->_queryProfile->bindParam($param, $variable); } } $this->_queryProfile->start(); } $retval = true; if ($params !== null) { $retval = $this->_execute($params); } else { $retval = $this->_execute(); } if ($this->_queryProfile) { $this->_queryProfile->end(); } return $retval; }
/** * Executes a prepared statement. * * @param array $params OPTIONAL Values to bind to parameter placeholders. * @return bool * @throws Zend_Db_Statement_Exception */ public function execute(array $params = array()) { if ($this->_queryProfile !== null) { $this->_queryProfile->bindParams($params); $this->_queryProfile->end(); } return true; }