I'm currently running Apache and PHP on a Fedora Core server i have dbase, odbc, and dba configured with php.
My question is the company I'm working for has a program that stores all their data into a Visual Fox Pro DBF file, but they would like this file to be read and updated by their web site as well. I have tried using dbase_open to read the file but when doing i receive an error that states "dbase_open() [function.dbase-open]: unable to open database fdadrugs.DBF"
I have also attempted to use dba_open no error when opening the file but when i try to get the keys it doesn't return anything.
Any help would be greatly appreciated.
Also here is the code both ways i am attempting
With DBASE
<?
$DBFfile = "fdadrugs.DBF";
$DBF = dbase_open($DBFfile,0) or die("Error! Could not open dbase database file '$DBFfile'.");
$Fields = dbase_get_header_info($DBF);
echo "<table cellspacing=0><tr><th>Name</th><th>Type</th>
<th>Length</th><th>Precision</th><th>Format</th><th>Offset</th></tr>";
foreach($Fields as $val)
{
echo "<tr>
<td>{$val['name']}</td>
<td>{$val['type']}</td>
<td>{$val['length']}</td>
<td>{$val['precision']}</td>
<td>{$val['format']}</td>
<td>{$val['offset']}</td>
</tr>";
}
echo "</table><br><br>";
?>
With DBA
<?
$DBFfile = "fdadrugs.DBF";
$DBF = dba_open($DBFfile,"r") or die("Error! Could not open dbase database file '$DBFfile'.");
if ($key = dba_firstkey($DBF)) do {
print("Key: $key Value:");
print dba_fetch($key, $DBF);
print("<BR>");
} while ($key = dba_nextkey($DBF));
?>