I want to be able to open the file and import it to a mysql database, updating the mysql table on a regular basis.
The problem: I tried the following code
Code: Select all
$id = @dbase_open("contacts.dbf", 0)
or die ("Could not open dbf file.");
$record = dbase_get_record($id, 955);The program DBFview shows me this info about the file:
Code: Select all
C:\www\contacts\contacts.dbf
File size (bytes): 1793394
Version: FoxPro with memo, index present
Number of records: 9640
N Field name Type Width
---------------------------------
1 ID Numeric 10
2 LINKID Numeric 10
3 FNAME Character 24
4 LNAME Character 24
5 COMPANY Character 48
6 COMPID Character 8
7 OCUPATION Character 16
8 POSITION Character 16
9 LASTUPDATE Float 19.9
10 TEXTBLOB Memo 10
---------------------------------
Total: 186BTW: I can't just use something like dbfviewer to produce the sql to insert it into a mysql table, because the file is "live" being changed daily by another application.
BBTW: the contacts.dbf file I'm testing on, is NOT live -- it has been copied to another directory so I can play with it, without damaging the original.
My Setup:
Apache2
PHP5 (with php_dbase.dll)
win xp
I'm thinking, perhaps there might be a way to treat this as a flat text file that I can extract rows from. Not sure, I'll have to play with it.
If I left anything out, ask me..... and thanks in advance.