Re: DB/mysql.php update
| From: | Tomas V.V.Cox | Date: | Wed, 28 Mar 2001 12:10:36 +0000 |
| Subject: | Re: DB/mysql.php update | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-124@lists.php.net to get a copy of this message | ||
Paul Rees wrote:
>
> In article <3AC142DB.A462188B@idecnet.com>, Tomas V.V.Cox
> <cox@idecnet.com> writes
> >I have also fixed fetchInto in oci8 and do some work on ibase (see cvs
> >log for the complete summary).
>
> Hi Tomas,
>
> The addition of:
>
> if ($rownum !== NULL) {
> return $this->raiseError(DB_ERROR_NOT_CAPABLE);
> }
>
> ... into the fetchInto function in oci8.php has re-introduced the
> problem I mentioned yesterday. Changing the above test to:
>
> if ($rownum != NULL)
>
> ... fixes it for me.
Hi Paul,
The problem probably resides in DB.php. Because the note from Jon about
the unreadability of putting 0 as default $rownum param, I prefered to
use null values. But this didn't change in DB.php.
Probably the fix is:
DB.php
------
function fetchRow($fetchmode = DB_FETCHMODE_DEFAULT, $rownum=null)
and
function fetchInto(&$arr, $fetchmode = DB_FETCHMODE_DEFAULT,
$rownum=null)
{
if ($fetchmode == DB_FETCHMODE_DEFAULT) {
$fetchmode = $this->dbh->fetchmode;
}
return $this->dbh->fetchInto($this->result, $arr, $fetchmode,
$rownum);
}
Please if you can test this, I'll can fix it this night.
Sorry for the inconvenience and thanks for the useful reports.
Tomas V.V.Cox