Bug #17989: Pear->db->oci8->numrows

From: Date: Wed, 26 Jun 2002 08:57:31 +0000
Subject: Bug #17989: Pear->db->oci8->numrows
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-7366@lists.php.net to get a copy of this message
From: awu@elca.ch Operating system: all PHP version: 4.2.0 PHP Bug Type: PEAR related Bug description: Pear->db->oci8->numrows Numrows function for Oracle does not return the correct number if "DISTINCT" is used in the query. ("distinct" is dropped..) have a look at /PEAR/DB/oci8.php line 268: numRows function: $countquery = preg_replace('/^\s*SELECT\s+(.*?)\s+FROM\s+/is','SELECT COUNT(*) FROM ',$this->last_query); doesn't work for queries with the keyword "DISTINCT" I suggest you something really more simple: $countquery = "SELECT count(*) FROM (".$this->last_query.")"; bye! -- Edit bug report at http://bugs.php.net/?id=17989&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17989&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17989&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17989&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17989&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17989&r=support Expected behavior: http://bugs.php.net/fix.php?id=17989&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17989&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17989&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17989&r=globals

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