<?php foreach ($file as $line) { $mail = $data[1]; $query = 'update emails set sent = "1" where sent = "0" and email = "'.$mail.'";'; } ?>
W zaczytywanym pliku jest ponad 330.000 linii. Czy da się to jakoś przyśpieszyć


<?php foreach ($file as $line) { $mail = $data[1]; $query = 'update emails set sent = "1" where sent = "0" and email = "'.$mail.'";'; } ?>
LOAD DATA LOCAL INFILE '/srv/www/newmailing/log2' INTO TABLE temptable FIELDS TERMINATED BY ' -> ';
UPDATE emails JOIN temptable USING(email) SET sent = "1" WHERE trim(BOTH "\n" FROM emails.email) = temptable.email;