fixed problem

From: Date: Tue, 26 Aug 2003 14:40:10 +0000
Subject: fixed problem
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20561@lists.php.net to get a copy of this message
Hi! I had some problems while using the DB_DataObjects ->count function with an Oracle DB. The problem was: i got no result. I found out that you can't call a "select" with "as __num". It causes an DB:Error. So I changed "__num" to "NUM". That fixed the Error but i still got no result. So I also changed the fetchRow call. Here's the changed code from DataObjects.php that works: function count($whereAddOnly = false) { [...] $r = $this->_query( "SELECT count({$this->__table}.{$keys[0]}) as NUM FROM {$this->__table} {$this->_join} {$this->_condition}"); if (PEAR::isError($r)) { return false; } $this->_condition = $tmpcond; $result = &$_DB_DATAOBJECT['RESULTS'][$this->_DB_resultid]; $l = $result->fetchRow(DB_FETCHMODE_ASSOC); return $l['NUM']; [...] } hope, it helps you Patrick

« previous php.pear.dev (#20561) next »