Re: a bug in DB_common
| From: | (Stig Sæther Bakken) | Date: | Mon, 12 Mar 2001 09:37:46 +0000 |
| Subject: | Re: a bug in DB_common | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-1794@lists.php.net to get a copy of this message | ||
[Alexey Borzov <borz_off@rdw.ru>]
> 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];
> }
Hi, thanks for the notice, it's fixed in CVS.
- Stig
--
Stig Sæther Bakken <ssb@fast.no>
Fast Search & Transfer ASA, Trondheim, Norway