Re: DB_common::getAll fix
| From: | Tomas V.V.Cox | Date: | Mon, 23 Jul 2001 00:33:36 +0000 |
| Subject: | Re: DB_common::getAll fix | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-991@lists.php.net to get a copy of this message | ||
Oleg Rekutin wrote:
>
> Ok, I updated my copy of PEAR DB component w/ the latest from CVS and it
> broke my application.
>
> Turns out, for some reason, getAll had its parameters switched. However, the
> compat check failed to work properly. It checked whether $fetchmode (the 3rd
> parameter) is an array. Well, all of my getAll calls never passed in an
> array, they just passed in $sql, DB_FETCHMODE_ASSOC. The compat check failed
> to detect an array as the third parameter (since it defaulted to
> DB_FETCHMODE_blah) and things broke down from then on.
Thanks Oleg, I've commit a fix. Finally it was not so easy as you said
:) I tested it with these params:
$db->getRow('select * from clientes', null, null);
$db->getRow('select * from clientes', DB_FETCHMODE_ASSOC, array('1'));
$db->getRow('select * from clientes', array('1'), DB_FETCHMODE_ASSOC);
$db->getRow('select * from clientes', null, array('1'));
$db->getRow('select * from clientes', DB_FETCHMODE_ASSOC, null);
Please let me know if you find something wrong.
>
> Hope it works... BTW, it would be nice to have such API changes documented
> somewhere.
>
True, it's always the same problem: the lack of a package distribution
system with release notes and decent changelog. Some day, stay tuned ;)
Tomas V.V.Cox