PHP and dbase

wxdqz

New Member
I am using php4 with an apache server in a win32 environment.
I have to use old dbase with PHP, i have been able to open dbase files, read them add records. But when i want to use dbase_replace_record function, the exiting record is replaced by a record with null string or zero values depending on the type of fields.The code is as follows:
$DbFile = dbase_open("test.dbf", 2);
if ($DbFile)
{
$Array = dbase_get_record($DbFile, 1);
// Generate a new array by removing
// deleted array element
$Ndata=array_slice($Array,sizeof($Array)-1));
$Ndata[2] = "New";
dbase_replace_record($DbFile,$Ndata, 1);
}
dbase_close($DbFile);

When i read the record again, all values are null whatever which values were.



}
 
Back
Top