php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8297 see test program below
Submitted: 2000-12-16 13:10 UTC Modified: 2001-02-24 12:44 UTC
From: hans dot klausmann at bwl dot fh-regensburg dot de Assigned:
Status: Closed Package: *Function Specific
PHP Version: 4.0.3pl1 OS: Win98
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: hans dot klausmann at bwl dot fh-regensburg dot de
New email:
PHP Version: OS:

 

 [2000-12-16 13:10 UTC] hans dot klausmann at bwl dot fh-regensburg dot de
<?
// PHP Version 4.0.3pl1
// dbase_get_record Function error
// ================
// Boolean value shows always 0
// run this test!
// same result with dbase_get_record_with_names!

$dbname = "c:/tmp/test.dbf";
// Datenbank-"Definitionen"
$def =
array(
array("Datum",       "D"),
array("Name",        "C",  50),
array("Alter",       "N",   3, 0),
array("Email",       "C", 128) ,
array("Mitglied", "L"),
);
// Generate table
dbase_create($dbname, $def);
// write two records
$db=dbase_open($dbname,2);
$record[0]='20001216';
$record[1]='Meier';
$record[2]=20;
$record[3]='test@test.de';
$record[4]='Y';
dbase_add_record ($db, $record);
$record[0]="20001217";
$record[1]="Meier";
$record[2]=20;
$record[3]='test@test.de';
$record[4]='N';
dbase_add_record ($db, $record);
dbase_close($db);
// open for read
$db=dbase_open($dbname,0);
$num=dbase_numrecords ($db);
echo "Number of rows: ".$num;
$nf  = dbase_numfields($db);
echo " Number of fields: ".$nf."<br>";
for ($recno=1; $recno<=$num; $recno++) {
$rec = dbase_get_record($db, $recno);
    for ($i=0; $i < $nf; $i++) {
    echo $rec[$i]."&nbsp;&nbsp;" ;
      if ($recno==1 && $i==4 ) echo "(=this Value should be -1!)";
    }
    echo "<br>";
}
dbase_close($db);

?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-16 15:25 UTC] waldschrott@php.net
Please provide a reduced code fragment (<15 lines) producing
this behaviour.
Put no database queries etc. in it to ensure that we can
reproduce it easily unless it is not 100% related to some db
(or similar) function.
 [2001-02-24 12:44 UTC] jmoore@php.net
closed due to lack of feedback
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC