NYCPHP Meetup

NYPHP.org

[nycphp-talk] ODBC - DBF files

Jeff Siegel jsiegel1 at optonline.net
Fri Feb 6 12:23:46 EST 2004


I'm connecting to a local dbf file (ACT database, to be exact). The code 
below seems to work correctly. However, it some records are not getting 
picked up. I ran SQL Trace to see if the SQL fetch calls failed but 
there were no indications of failure. Just wondering if there is 
something else I might try. I'm using PHP 4.3.3 on Win XP and the Dbase 
ODBC drivers that are bundled with WinXP.

$link = odbc_connect('act','jeffrey siegel','') or die(odbc_error());

$query = "SELECT UNIQUE_ID, FNAME, LNAME, COMPANY, PHONE FROM 
Contacts.dbf ORDER BY COMPANY";
$result = odbc_exec($link,$query);

while(odbc_fetch_row($result)){
	$ary[] = odbc_fetch_array($result);
}
print_r($ary);
========
TIA,
Jeff Siegel




More information about the talk mailing list