Skip to content
Advertisement

I want to to fetch 100,000 records by an SQL query using MySQL XAMPP and save in an array, but it doesn’t even fetch 16,000 and halt or shows

Fatal error: Maximum execution time of 30 seconds exceeded in C:xampphtdocsMapRoutingRouting.php

Yes, I can set the maximum execution time, but I want the result in less time, like in MySQL when a person clicks on a table, it gives a result, e.g. showing rows 0 – 24 (16037 total, Query took 0.0032 seconds.)

JavaScript

Advertisement

Answer

I am not sure what your exact requirement of this code is, but your query efficiency seems very low.

You’re running too many queries that fetch only one row per query.

JavaScript

Try this and see for yourself:

JavaScript

If you want to run a query to get 4000 results per page/query?

Then following code would do that in 26 queries

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement