示例#1
0
 public function &query($a_query)
 {
     $tr = parent::getParent()->getTransaction();
     $this->free();
     $this->m_query_string = $a_query;
     $this->getParent()->setQuery($a_query);
     if ($tr) {
         $this->begin();
     }
     $c = $this->getConnection();
     if ($this->m_result = $c->query($a_query)) {
         if ($tr) {
             $this->commit();
         }
         return $this;
     }
     $this->m_error = new Zoombi_Database_QueryError($c->errno, $c->error, $a_query);
     if ($tr) {
         $this->rollback();
     }
     return $this;
 }
示例#2
0
 public function &query($a_query)
 {
     $tr = parent::getParent()->getTransaction();
     $this->free();
     $this->m_query_string = $a_query;
     $this->getParent()->setQuery($a_query);
     if ($tr) {
         $this->begin();
     }
     $result = mysql_query($a_query, $this->getConnection());
     if ($result === false) {
         $this->m_error = new Zoombi_Database_QueryError(mysql_errno($this->getConnection()), mysql_error($this->getConnection()), $a_query);
         if ($tr) {
             $this->rollback();
         }
         return $this;
     }
     if ($tr) {
         $this->commit();
     }
     $this->m_result =& $result;
     return $this;
 }