Files
archived-pecl-database-dbase/tests/example.php
Christoph Michael Becker 1cab294598 Backport test suite improvements from trunk
git-svn-id: http://svn.php.net/repository/pecl/dbase/branches/dbase-5.1@339844 c90b9560-bf6c-de11-be94-00142212c4b1
2016-08-11 09:50:13 +00:00

26 lines
630 B
PHP

<?php
// script to create the example database file
$filename = __DIR__ . DIRECTORY_SEPARATOR
. pathinfo(__FILE__, PATHINFO_FILENAME) . '.dbf';
$definition = array(
array('ID', 'N', 5, 0),
array('NAME', 'C', 25),
array('RELEASED', 'D'),
array('SUPORTED', 'L'),
array('PRICE', 'N', 10, 2)
);
$db = dbase_create($filename, $definition);
$records = array(
array(1, 'dBase III', '19840501', 'T', 123.45),
array(2, 'Clipper', '19850525', 'F', 56.78),
array(3, 'Visual FoxPro 7.0', '20010627', 'F', 0.90)
);
foreach ($records as $record) {
dbase_add_record($db, $record);
}
dbase_close($db);