Timeout for a large MySQL query

I have this code:

$theQuery = mysql_query("SELECT phrase, date from wordList WHERE group='nouns'");
while($getWords=mysql_fetch_array($theQuery)) {
 echo "$getWords[phrase] created on $getWords[date]<br>";
}

The query has 75,000 results, and every time I run the code, I get an error.

+3
source share
3 answers

Here you can play several questions, all of which are related to the settings in php.ini. Your script can be synchronized, since PHP by default has a maximum of 30 seconds to execute the script. Another reason (and exactly the same) is because you are pushing the script memory limit, which by default is 8 MB per script execution.

Open php.ini and search for "Resource restrictions" and make the appropriate changes.

+3
source

php.ini - , , , . , .

, , 25 000 LIMIT. , . // cron, , .

0

Source: https://habr.com/ru/post/1745011/


All Articles