Re: DB stuff
| From: | Tomas V.V.Cox | Date: | Mon, 26 Mar 2001 23:57:07 +0000 |
| Subject: | Re: DB stuff | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-108@lists.php.net to get a copy of this message | ||
Stig Sæther Bakken wrote:
>
> ["Tomas V.V.Cox" <cox@idecnet.com>]
>
> > - IMHO there is no need to mantain two versions with the same
> > functionality of fetchrow (fetchrow() and fetchinto()). I propose to
> > erase one in backend extensions and "emulate" the other throw DB_result.
> > Something like this in DB_result:
> >
> > // this code is only an approach
> > function fetchRow($fetchmode = DB_FETCHMODE_DEFAULT)
> > {
> > $res = $this->fetchInto ($arr, $fetchmode);
> > if (is_object($res)) {
> > return $res;
> > }
> > return $arr;
> > }
> > So, in extensions we'll only need fetchInto().
>
> Also agreed.
Umm ... I have a problem. I realize that the "get family" (getOne,
getRow, getCol, getAssoc and getAll) in common.php use fetchrow, so
erase this function from extensions is not posible yet.
As they are very comfortable, because you don't need to do a query by
hand, I think that they operate only with result sets and should go into
DB_result. What do you think about that?
> > - Can I start start coding the new "fetch absolute row numbers"
> > capability in DB_result? DB_ifx and DB_pgsql (this last not yet
> > commited) have now this feature implemented.
>
> Sure, go ahead. Could you also make the backends that don't support
> it yet return "not capable" if they get a non-null row-offset
> parameter?
Ok, in the next two days I'll do it. If noone wants I'll add also this
feature to mysql from the patch submited time ago (Abel Almazan). For
other backends like sybase or msql should be trivial to implement.
Perhaps an emulation for Oracle or Interbase should works well.
Tomas V.V.Cox