Ejemplo n.º 1
0
 public function getArrayResult(Database_QueryResult $oQResult)
 {
     if ($oQResult->isError()) {
         return $oQResult;
     }
     if (!is_resource($oQResult->rResource)) {
         return $oQResult->error('database.incorrect_resource');
         // TODO uzupelnic string table
     }
     $aResult = array();
     while ($aRow = mysql_fetch_array($oQResult->rResource, MYSQL_ASSOC)) {
         $aResult[] = $aRow;
     }
     return $oQResult->result($aResult);
 }
Ejemplo n.º 2
0
 public function query(Database_Query $oQuery)
 {
     $this->iQueryCount++;
     $this->oLastQueryResult = $this->oDriver->query($oQuery);
     $this->aQueryHistory[] = $this->oLastQueryResult->sql();
     if ($this->oLastQueryResult->isError()) {
         return false;
     } else {
         if ($oQuery->returnResult()) {
             return $this->oDriver->getArrayResult($this->oLastQueryResult)->result();
         } else {
             return true;
         }
     }
 }