Esempio n. 1
0
 protected function executeQuery(Database_QueryResult $oQResult)
 {
     if (!($oQResult->rResource = mysql_query($oQResult->sql(), $this->oResource))) {
         if (!IN_PRODUCTION) {
             throw new Lithium_Exception_Database('database.query_failure', $oQResult->sql(), $this->getError());
         } else {
             $oQResult->error('database.query_failure');
             self::$oLithium->logError('database.query_failure', $sSql, $this->getError());
         }
     }
     return $oQResult;
 }
Esempio 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;
         }
     }
 }