There is MySQL table with 24500 rows of data, and there is text file with 26000 string of data needed to be inserted into MySQL, problem is what this 26000 strings duplicates data in MySQL table, so we need to compare them, and insert only new/unique.
cadastreArray - array from text file
districtArray - mysql array
When i try to do
foreach ($cadastreArray as $cadastreValue) {
$districtExist = false;
foreach ($districtArray as $districtData) {
if ($cadastreValue[0] == $districtData['1']) {
$districtExist = true;
break;
}
}
}
if(!$districtExist) { MySQL INSERT ... }
i am getting execution time error, and even 3 minutes are not enought. Maybe you can offer better/faster way?