I am checking emails with SMTPValidationTool. There are about 2500 rows with emails in the database. PHP script loops through that emails with fetch_assoc() and finds wrong emails. But here is a problem. When I have a small database with 10 emails, everything works perfectly. But when I upload about 2500 or even 1000 emails, after ~ 1 minute 15 seconds or much longer PHP script throws Internal server error 500. All of PHP scripts have set_time_limit(200) and max_execution_time is 300. Nothing helps. I thought that something is saving rows(buffering). I have used MYSQLI_USE_RESULT parameter. But this doesn't help. Help me please! :c I have no idea why this happens... Here is my PHP script:
<?php
set_time_limit(200);
chdir('..');
require 'config/config.php';
require 'vendor/autoload.php';
use SMTPValidateEmail\Validator as SmtpEmailValidator;
$validator = new SmtpEmailValidator();
$db = new mysqli($db['host'], $db['user'], $db['pass'], $db['db']);
if ($db->connect_error) {
die("Unable to connect database: " . $db->connect_error);
}
$query = $db->query("SELECT email FROM import", MYSQLI_USE_RESULT);
$wrong_count = 0;
while($row = $query->fetch_assoc()){
$result = $validator->validate($row);
if (!$result[$row['email']]) {
$wrong_count+=1;
$db->query("DELETE FROM import WHERE email='".$row['email']."'");
}
}