php - How to make sure all data are inserted into database? -


i have 3400 data , want insert of data database. but, seems data skipped during process. how make sure data inserted. thank you.

here code:

<?php    include 'koneksi.php'; mysql_query("truncate token");  $komentar=mysql_query("select * dataset_komentar") or die(mysql_error()); $stopwords=mysql_query("select * stopwords") or die(mysql_error());  $index=0;  $arrsw=array(); while ($result1=mysql_fetch_assoc($stopwords)) {     $arrsw[$index]=$result1['kata'];     $index++; }  if (mysql_num_rows($komentar)>0){     while ($result2=mysql_fetch_assoc($komentar)) {         $str2=$result2['komentar'];         $newstr=preg_replace('/[^a-za-z]/', ' ', strtolower($str2));         $newstr=str_replace("'", '', $newstr);          $token=strtok($newstr, " ");         $kata="";          while ($token) {             ($i=0; $i<count($arrsw); $i++) {                  if (trim($arrsw[$i])==$token) {                     $token="";                 }             }             $kata.=$token." ";             $token=strtok(" ");             if (!empty($token)) {                 mysql_query("insert token values('','$token') on duplicate key update hasil_token=hasil_token")or die(mysql_error());               }         }     } } else {     echo "no data !"; }?>  


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -