/** * MPE, SESCOOP * atualiza dados da devolutiva gerada para um determinado numero de protocolo * * @param type $devolutivePath * @param type $idProtocolo * @return boolean */ public static function gravaPathDevolutiva($devolutivePath, $idProtocolo) { $db = Zend_Registry::get('db'); $sql = "UPDATE ProtocoloDevolutiva SET DevolutivePath = ? WHERE Id = ?"; $stmt = new Zend_Db_Statement_Mysqli($db, $sql); $params = array($devolutivePath, $idProtocolo); $stmt->execute($params); $db->closeConnection(); return true; }
/** * Prepare a statement and return a PDOStatement-like object. * * @param string $sql SQL query * @return Zend_Db_Statement_Mysqli */ public function prepare($sql) { $this->_connect(); if ($this->_stmt) { $this->_stmt->close(); } $stmtClass = $this->_defaultStmtClass; Zend_Loader::loadClass($stmtClass); $stmt = new $stmtClass($this, $sql); if ($stmt === false) { return false; } $stmt->setFetchMode($this->_fetchMode); $this->_stmt = $stmt; return $stmt; }
/** * Prepare a statement and return a PDOStatement-like object. * * @param string $sql SQL query * @return Zend_Db_Statement_Mysqli */ public function prepare($sql) { $this->_connect(); if ($this->_stmt) { $this->_stmt->close(); } $stmtClass = $this->_defaultStmtClass; if (!class_exists($stmtClass)) { //require_once 'Zend/Loader.php'; Zend_Loader::loadClass($stmtClass); } $stmt = new $stmtClass($this, $sql); if ($stmt === false) { return false; } $stmt->setFetchMode($this->_fetchMode); $this->_stmt = $stmt; return $stmt; }
/** * (non-PHPdoc) * @see library/Zend/Db/Statement/Zend_Db_Statement_Mysqli::fetchAll() */ public function fetchAll($style = null, $col = 0) { $result = parent::fetchAll($style, $col); if (isset($result[0])) { for ($iLine = 0; $iLine < count($result); $iLine++) { if (is_array($result[$iLine])) { foreach ($result[$iLine] as $key => $value) { unset($result[$iLine][$key]); $result[$iLine][$this->_adapter->foldCase($key)] = $value; } } else { $object = new stdClass(); foreach ($result[$iLine] as $key => $value) { $object->{$this->_adapter->foldCase($key)} = $value; } $result[$iLine] = $object; } } } return $result; }
/** * Prepare a statement and return a PDOStatement-like object. * * @param string $sql SQL query * @return Zend_Db_Statement_Mysqli */ public function prepare($sql) { $this->_connect(); $stmt = new Zend_Db_Statement_Mysqli($this, $sql); $stmt->setFetchMode($this->_fetchMode); return $stmt; }
/** * Prepare a statement and return a PDOStatement-like object. * * @param string $sql SQL query * @return Zend_Db_Statement_Mysqli */ public function prepare($sql) { $this->_connect(); if ($this->_stmt) { $this->_stmt->close(); } $stmt = new Zend_Db_Statement_Mysqli($this, $sql); if ($stmt === false) { return false; } $stmt->setFetchMode($this->_fetchMode); $this->_stmt = $stmt; return $stmt; }
public function __construct($db, $sql, $shardID = 0) { try { parent::__construct($db, $sql); } catch (Exception $e) { Zotero_DB::error($e, $sql, array(), $shardID); } $this->link = $db; $this->sql = $sql; $this->shardID = $shardID; $this->isWriteQuery = Zotero_DB::isWriteQuery($sql); }
/** * processa execucao de procedures que calculam pontuacao a partir das * respostas do Questionario de Empreendedorismo * * @param type $QuestionnaireId * @param type $UserId * @param type $BlockId * @param type $CompetitionId * @return boolean */ public function processaCaracteristicaEmpreendedora($QuestionnaireId, $UserId, $BlockId, $CompetitionId) { //forma correta $db = Zend_Registry::get('db'); $sql = "CALL p_pontuacao_grade (?, ?, ?, ?)"; $stmt = new Zend_Db_Statement_Mysqli($db, $sql); $params = array($QuestionnaireId, $BlockId, $UserId, $CompetitionId); $stmt->execute($params); //$stmt->fetch(); $db->closeConnection(); return true; }
public function calculateScoreFromQuestionnaireAnswers($QuestionnaireId, $UserId, $BlockId, $CompetitionId) { //forma correta $db = Zend_Registry::get('db'); $sql = "CALL p_pontuacao_grade (?, ?, ?, ?)"; $stmt = new Zend_Db_Statement_Mysqli($db, $sql); $params = array($QuestionnaireId, $BlockId, $UserId, $CompetitionId); $stmt->execute($params); //$stmt->fetch(); $db->closeConnection(); return true; }