I am using simple PHP query to fetch rows from the database, there are above 7000 rows in the table and whenever I fetch all rows, the PHP doesn’t work and script dies, but when I limit the results to 6400 everything works fine.
Is there any limitation in MySQL or PHP that I should be aware of? If any, where I need to configure these settings.
Any help is highly appreciated.
Please note that my PHP settings allow the script execution time of 1800 seconds and memory usage is set to 512MB.
I am using simple PHP query to fetch rows from the database, there are
Share
Why do you need that much rows? I’m pretty sure php dies because it runs out of memory.
Run your query in a console to see if you get there more than 7000 rows without issues. If it returns them all there you can be sure it’s php and not your database and I’m sure it is php.
For whatever you do, it would be better to loop over the data, also known as “pagination” and read it in chunks of for example 100 rows and process it, 0-100, 100-200, 200-300…