I am parsing data from a flat file into a MySQL database. I am currently testing my PHP parser. I have test files with 1 record, 2 records, 3 records and 10 records. Ultimately, I will parse thousands of records into the database.
When I run the script, sometimes it runs to completion virtually immediately. Other times, it hangs in the middle until it times out. When it runs to completion, everything is fine. When it hangs, the early records in the file are parsed correctly, and the rest never get parsed.
I have discussed this at length with my hosting service. They said they thought the problem was between the web server and the PHP server. They have moved the site to a different server. Same problem. Then they said the problem may be with the way PHP is reading the input file. That is where we stand right now.
Has anyone ever seen this type of behavior before? Any suggestions?
Thank you!