Reputation: 11
I have successfully managed to append a record to a .dbf file using hasumi's php-xbase extension in PHP. However, the .fpt file containing memo data disappears every time I append a record.
use XBase\Enum\FieldType;
use XBase\Enum\TableType;
use XBase\Header\Column;
use XBase\Header\HeaderFactory;
use XBase\TableCreator;
use XBase\TableEditor;
use XBase\TableReader;
use XBase\Column\ColumnInterface;
$table_ed = new TableEditor('file.dbf',['columns' =>['pk','itemdesc']]);
$record = $table_ed->appendRecord()
->set("pk", 11111)
->set("itemdesc","");
$table_ed->writeRecord($record);
$table_ed->save()->close();
The memo data would be in the "itemdesc" column, which after debugging, seems to have correctly registered as a memo field. No errors appear to indicate any issues.
Have I missed something that can update an .fpt file? Any help would be very much appreciated.
Upvotes: 1
Views: 131