I posted PHP connect DBF file with a sample. Now Pierre left the message and asked why error comes up.
I doing some tests and get the answer.
1) The database.dbf is reserved name.
2) The field name is always capital.
Let me give the better sample here.
require_once ( 'odbc.php' ); $strsql = 'SELECT * FROM dat.dbf' ; $query = odbc_exec( $odbc , $strsql ) or die (odbc_errormsg()); while ( $row = odbc_fetch_array( $query )) { echo 'Client Name: ' . $row [ 'NAME' ].' '; echo 'Client Phone Number: ' . $row [ 'PHONE' ].' '; echo '<hr />' ; } odbc_close( $odbc ); |
i copied and tested the code you provided.. but still i always end up with this error.
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC dBase Driver] Syntax error in FROM clause., SQL state 37000 in SQLExecDirect in G:\wamp\www\MAPS\Map for Web 2011\trial.php on line 4
[Microsoft][ODBC dBase Driver] Syntax error in FROM clause.
what will i do to solve this problem?