Esempio n. 1
0
 /**
  * Binds a parameter to the specified variable name.
  *
  * @param mixed $parameter Name the parameter, either integer or string.
  * @param mixed $variable  Reference to PHP variable containing the value.
  * @param mixed $type      OPTIONAL Datatype of SQL parameter.
  * @param mixed $length    OPTIONAL Length of SQL parameter.
  * @param mixed $options   OPTIONAL Other options.
  * @return bool
  * @throws Zend_Db_Statement_Exception
  */
 public function bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
 {
     if ($this->_queryProfile !== null) {
         $this->_queryProfile->bindParam($parameter, $variable);
     }
     return true;
 }
Esempio n. 2
0
 /**
  * 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;
 }