C
C
Carry2020-06-08 16:25:46
PHP
Carry, 2020-06-08 16:25:46

PHP MySQL Loop queries after certain count no result?

Windows system, PHP 7.1, MySQL 5.7 In MySQL, set all timeout variables to
3600sec .

$this->db = mysqli_init();
$this->db->real_connect(....);
foreach ($arr as $id) {
    $this->db->query('SELECT * FROM tbl WHERE .....')
}

Query 1 Time 300sec
Query 2 Time 184sec
Query 3 Time 247sec
Query 4 Time 0.012sec
.....

So the problem is that always after the 3rd query the result is 0, i.e. the request does not produce anything (although if you start with it, there will also be a result), and after 5 such requests, approximately 3-4 starts to execute again. It doesn't throw any error though.
Probyval even through CMD to run in a cycle without foreach in PHP the same problem ...
Where to dig?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question