a bug in DB_common
| From: | Alexey Borzov | Date: | Mon, 12 Mar 2001 08:08:22 +0000 |
| Subject: | a bug in DB_common | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-1792@lists.php.net to get a copy of this message | ||
Greetings, php-pear!
in function getAssoc() there is a loop which is supposed to return
array of the form (first_col => second_col):
// return scalar values
while (($row = $this->fetchRow($res)) && !DB::isError($row)) {
$results[$row[0]] = $row[1];
}
it insists on accessing the $row's values by numeric indices and fails
miserably when the default fetchmode is DB_FETCHMODE_ASSOC. I suppose
the loop should read:
// return scalar values
while (($row = $this->fetchRow($res, DB_FETCHMODE_ORDERED)) &&
!DB::isError($row)) {
$results[$row[0]] = $row[1];
}
--
Yours, Alexey V. Borzov, Webmaster of RDW.ru