I am developing a site for a Real Estate Agency...
Basically, the listings come in from a regional database via text files.
We are given access to an FTP which I am using cron tabs to download the files from at scheduled times.
I have also been give a very strict layout for my database. Which I have laid out.
The format of the data download is a zip file which includes about 12 text files, and the data inside these text files is as follows...
(This is the smallest of the group)
First 5 lines:
agentcode|officecode|namefirst|namemi|namelast
60005982|YFRR10|Jennipher||Samms
60005983|MOLES|Keisha|L|Harling
60005984|MOLES|Chad|F|Casey
60005987|ERAJER|Stephen|G|Bradshaw
I used the LOAD INFILE query inside phpMyAdmin and it gave me problems. Also, the first line of every file has that list of fields, but they dont match the actual field names, so I guess they will just get inserted into the database with all the other data...
What I need to do basically is have a script that executes after the dowload/unzip and basically either UPDATE/ADD to the database or totally ERASE/OVERWRITE the database depending on the day of the week...
Can anyone show me a query that will work?