ลองแบบ Odbc และ Free table
<?php
$db = 'c:\\repmain\\data\\';
$dsn = "Driver={Microsoft Visual Foxpro Driver};SourceType=DBF;SourceDB=$db";
$cn = odbc_connect($dsn,'','') or die("ติดต่อฐานข้อมูลไม่ได้");
$sql = 'SELECT * FROM pt ';
$rs = odbc_exec($cn,$sql) or die("รัน SQL ไม่ผ่าน");
if ($rs) {
echo "Rs Complete";
} else {
echo "Rs Not Complete";
}
echo "<br>";
echo "<table border=1>";
$fields = odbc_num_fields($rs);
while( odbc_fetch_row($rs) ) {
echo "<tr>";
for ($j=1; $j < $fields+1; $j++) {
echo "<td>". odbc_result($rs, $j) . "</td>";
}
echo "</tr>";
}
echo "</table>";
odbc_close($cn);
?>