I need to access an external .dbf flat file database and import into a mySQL database on my website.
I have it running okay on my lone computer having set up a systemDNS linking to the .dbf files. I can also extract data and covert variables to my mySQL table format using:
<?php
//connect to old database
$connectionstring = odbc_connect("FoxPro","","");
$filename = "DEBTORS.DBF";
if (file_exists("c:/pc6demo/pc6data/$filename")) {
echo "$filename file exists<br>";
}
else {
echo "File does not exist<br>";
}
echo "<table width='500' align='center'>";
echo "<tr><th>Index</th><th>Field</th><th align='left'>File</th><th>Length</th></tr>";
$query = "SELECT * FROM $filename";
$result = odbc_do($connectionstring, $query);
while(odbc_fetch_row($result)) {
$code = odbc_result($result, 2);
$zone = odbc_result($result, 8);
$name = odbc_result($result, 4);
$sman = odbc_result($result, 10);
echo "<tr><td>$code</td><td>$zone</td><th align='left'>$name</th><td>$sman</td></tr>";
}
echo "</table>";
// close database
odbc_close($connectionstring);
?>
Now, I want to achieve this from an externally hosted web site where I do not have access to setup a systemDNS. I understand it is possible to write a non systemDNS. How is this done?
Also what do I need to setup on the target server by way of directory and file access permissions?
I assume I can access using the target IP address?
Thanks in advance.