I have a PHP script that queries the database for a fairly large number of rows, using mysql_query(), then runs through those rows and stores them in PHP array using mysql_fetch_array() for each row. The script does nothing else during the loop, just data storage in an array. For example, on 15,000 rows, it will loop for about 8000 rows, then all processing stops. The server returns a blank page, no time out warning, nothing, just says “Done” in the status bar at bottom of browser.
After loading the array, the script uses in the information for further processing … but of course the script doesn’t get to that point.
However, if I instead use mysql_fetch_array() to get one row, then do some PHP processing on that row, THEN get the next row, etc, instead of immediately storing everything into an array first, then it works.
What could be causing the termination? Is it calling mysql too fast during the loop? Is there a mysql memory problem? I doubt it’s a PHP limitation on array size. It’s also not a PHP timeout issue; it quits long before that (I’ve checked).
I’m using XAMPP on Windows, by the way; however, I’ve seen a similar thing on my live linux server when doing large queries, where the server returns a blank “Done” page.
Thanks for any advice. I have to say this forum is a life-saver.