Php/mysql/cron Conversion Job
Automated MLS Load Cron Job Steps
1. Test if “root/NEWMLS.txt” file exists, if not display NEWMLS.txt file missing, Load Canceled” and cancel job.
2. Test if “recprty” table exists in database warehous_mysql, if it does display “MLS Load Process Aborted needs Recovery…cancelling” and cancel job.
3. Rename “properties” table to “recprty” table.
4. Run new mlsload.php program to create the newest MLS file.
a. Read next “NEWMLS.txt” file record (WHERE PROP_TYPE_CODE=”C” and BUILDING_SQUARE_FOOTAGE > 6,000), and if end of file, end program.
b. To skip duplicate records, SELECT “properties” table (created so far) record for same STREET_NUMBER, STREET_NAME, STREET_DIRECTION, CITY, MLS_STATE_ID, & ZIP_CODE, to see if one already exists, if so, skip this record.
c. If CITY field = null, get new “city” table for CITY_ID and load city_name into CITY field.
d. Load all fields (including new SF_PRICE, SF_OFFICE, RECORD_TYPE, SLDOORS, DOCKS, CEILING, FEATURES fields) one for one by record read in.
e. To keep entered data, Select “recprty” table for same STREET_NUMBER, STREET_NAME, STREET_DIRECTION, CITY, MLS_STATE_ID, & ZIP_CODE, if a matching record exists then load it’s SF_PRICE, SF_OFFICE, RECORD_TYPE, SLDOORS, DOCKS, CEILING, FEATURES, and REMARKS values into this tables fields.
f. Add new record to “properties” table and goto 4.a above.
5. Delete “recprty” table and “root/NEWMLS.txt” file.
6. Display “MLS Database Load successful”



