From:             sdmaster at mail dot ru
Operating system: Windows XP SP2
PHP version:      5.2.3
PHP Bug Type:     dBase related
Bug description:  dbase functions return not all records from a dbf file

Description:
------------
I'm using Apache 2.2.4, php 5.2.3 loaded with LoadModule. php_dbase
extension v5.2.3.3. Apache is run from a local administrator's account.

after I open a dbf file and use dbase_numrecords() to retrieve number of
records in the file, it returns a number that is randomly less than actual
by 1, 2 or 3. accordingly, dbase_get_record_with_names() doesn't want to
get, i.e., 23-th record from a 24-records dbf file.

a sample dbf file is created by Delphi 7 TDbf component v6.9 and contains
russian characters in string fields.

at the same time such tools as DBV Viewer or like show everything
correctly.

reference to the sample dbf file lies inside comments in the posted php
code.

Reproduce code:
---------------
<?

/*

 a simple php code, purely from examples

 test file is generated by TDbf Delphi 7 component

 a sample dbf file, which is reported by php dbase functions to
 have 1 records less than actual, could be taken from here:

 http://b64.hopto.org/test.dbf

*/

if ($db = dbase_open('c:\temp\test.dbf', 0)) {

  $rn = dbase_numrecords($db);

  for ($i = 1; $i<=$rn; $i++) {
      $row=dbase_get_record_with_names($db, $i);
      print_r($row);
  }

  dbase_close($db);

}

?>

Expected result:
----------------
all records from dbf file

Actual result:
--------------
all records except the last one

-- 
Edit bug report at http://bugs.php.net/?id=41913&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41913&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41913&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41913&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41913&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41913&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41913&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41913&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41913&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41913&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41913&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41913&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41913&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41913&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41913&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41913&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41913&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41913&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41913&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41913&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41913&r=mysqlcfg

Reply via email to