I have searched the web and can't find a working line to connect php to a foxpro database I have tried using ODBC and get errors.
Does anyone have working code.
Here is what I have tried:
$link = odbc_connect ('advassistant', '', '', 0)
or die ("Could not connect");
print ("Connected successfully to foxtest");
$result = odbc_exec($link, "SELECT * FROM SVCCAR");
if (!$result) {
echo odbc_error();
exit;
}
odbc_close ($link);
which returns that no default driver
And odbcless:
$table = 'c:\aa\AAADDR.DBF';
if (!$FileHandler = dbase_open($table,0) ) {
echo "Can't open $table\n";
exit;
} else {
$rowcount = dbase_numrecords ( $FileHandler);// How many records?
for ($i=1; $i <= $rowcount; $i++) {
$row = dbase_get_record_with_names($FileHandler,$i);
echo chop($reg[ID_EMP]) . " : " .
chop($reg[ID_SUBEMP]) . " : " .
chop($reg[NAME_EMP]);
}
}
Which returns the error that dbase_open is not good code.
Thanks in advance.