60) { $index++; // pn $pieces = explode(' ) ', $str); // PF4M40Z8 - LENOVO-V15-G4-IAH ( 83FS002DRA ) NBLN V15 G4 IAH I5 8G 8G 512G 11P - 34 - 2023-11-26 $pieces2 = explode(' ( ', $pieces[0]); $pn = $pieces2[1]; // sn $piecessn = explode(' - ', $str); $sern = $piecessn[0]; // model $piecessn = explode(' - ', $str); $piecesmodel = explode(' - ', $pieces2[0]); $model = $piecesmodel[1]; // spec $piecesspec = explode(' - ', $pieces[1]); $spec = $piecesspec[0]; // month warranty rest $waranty_rem = $piecesspec[1]; // start warranty $waranty_start = $piecesspec[2]; // echo "-".$pn."-
"."-".$sern."-
"."-".$model."-
"."-".$spec."-
"."-".$waranty_rem."-
"."-".$waranty_start."-
"; // echo $str."
"; if (strlen($pn) == 10) { $now = date("Y-m-d H:i:s"); $sql = "INSERT INTO `Lenovo`(`date_add`, `model`, `pn`, `sn`, `month`, `spec`, `date_sell`) VALUES ('".$now."','".$model."','".$pn."','".$sern."','".$waranty_rem."','".$spec."','".$waranty_start."');"; // mysqli_query($link, $sql); if (mysqli_query($link, $sql)) { $index_ok++; // echo $str."
"; } } // if pn == 10 } // if strlen >60 } //echo ('All strok: '.$index. ' New strok: '. $index_ok); fclose($f); // file_put_contents('insert4.txt', date('d-m h:i:s')." - START - ".$index_ok." - ".PHP_EOL, FILE_APPEND); // if (strlen($pn) == 10) { // $now = date("Y-m-d H:i:s"); // $sql = "INSERT INTO `Lenovo`(`date_add`, `model`, `pn`, `sn`, `month`, `spec`, `date_sell`) // VALUES ('".$now."','".$model."','".$pn."','".$sern."','".$waranty_rem."','".$spec."','".$waranty_start."');"; // mysqli_query($link, $sql); // } ?>