I try to upload my data to mysql Its working but it takes 35sec, too many sec.
What do I need to change in my code that it will work faster than 35 sec?
I use php to write my code and SQL query to send the data to my table that called "words" .
At my table in the database I have 4 columns ('word', 'num', 'hit', 'instoplist').
What I can do to fix this problem?
Thanks
This is my code:
<?php
function removeStopWordsFromArray($words)
{
.......
insert($words);
}
function insert($myWords)
{
global $conn;
foreach ($myWords as $key => $value) {
$word = $value['word'];
$number = $value['document'];
$hit = $value['hit'];
$stop = $value['stopList'];
$sql = "INSERT INTO words (word,num,hit,instoplist) VALUES ('$word', '$number', '$hit','$stop')";
if($conn->query($sql)!== TRUE)
{
echo "error". $conn->error;
}
}
fclose($fp);
}
$temp = pareseDocs();
removeStopWordsFromArray($temp);
?>