php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23725 bug in callback fecthRow Sybase
Submitted: 2003-05-20 14:33 UTC Modified: 2003-06-21 12:22 UTC
From: cristianoarnold at yahoo dot com dot br Assigned: ssb (profile)
Status: Closed Package: PEAR related
PHP Version: 4.3.1 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: cristianoarnold at yahoo dot com dot br
New email:
PHP Version: OS:

 

 [2003-05-20 14:33 UTC] cristianoarnold at yahoo dot com dot br
Hi

I had some trouble when I tried call next time the following fetchRow:

$array = $result->fetchRow(DB_FETCHMODE_ASSOC, $i++);

It returns the result coorect but printed the message follow and exit

Warning: sybase_data_seek() [function.sybase-data-seek]: Sybase: Bad row offset in c:\php\pear\DB\sybase.php on line 287

The problem seems to be the following lines of code starting at line 287 of DB/sybase.php

       if ($rownum !== null) {
            if (!sybase_data_seek($result, $rownum)) {
                return $this->sybaseRaiseError();
            }
        }


The following change seems to fix the problem.

       if ($rownum !== null) {
            if (($rownum >= 0) && ($rownum <= $this->numRows($result))) {
                @sybase_data_seek($result, $rownum);
            } else {
                return $this->sybaseRaiseError();
            }
        }

Can you fix this problem in the pear.php.net library to next version?

Than you

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-21 12:22 UTC] cox@php.net
Fixed in CVS, will be shipped in next PEAR DB version.

Thanks for the report
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 12:01:28 2025 UTC