Re: fixed problem

From: Date: Wed, 27 Aug 2003 13:27:24 +0000
Subject: Re: fixed problem
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-20634@lists.php.net to get a copy of this message
I changed it to dataobject_num - let me know if that works - I've no idea why __num was used Regards Alan Patrick Roos wrote:
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
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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