title: How to import csv file to mysql more faster codeigniter
body: <p>Its working but when I import big files almost 2500+ lines in CSV files it load/import slowly and its say's error but some files are inserting ,some are not. And my question is there way to make it faster importing? I see in file But i don't get it how to use it.</p>
  
  <p>Code:</p>
  
  <pre><code>    function convert_csv($id){
                  if (empty($id)) redirect("contracts");
                  $config['upload_path']   = './files/contracts-csv/'; 
                  $config['allowed_types'] = 'csv';   
                  $config['max_size']      = '4096';      
                  $config['overwrite']     =  TRUE;
  
                  $this-&gt;load-&gt;library('upload', $config);
                  $this-&gt;upload-&gt;display_errors('', '');
  
                  if (!$this-&gt;upload-&gt;do_upload("csv_file")) {
                        echo $this-&gt;upload-&gt;display_errors(); die();
                        $this-&gt;data['error'] = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
                  } else {
                      $upload_result = $this-&gt;upload-&gt;data();
                      $upload_result = $this-&gt;upload-&gt;data(); 
                      $this-&gt;load-&gt;library('csvreader');
                      $result =   $this-&gt;csvreader-&gt;parse_file("./files/contracts-csv/".$upload_result['file_name']);
                      $date_today = date('Y-m-d H:i:s');
                          foreach ($result as $v) {
                              $this-&gt;contract_items-&gt;add_serial($v,$id,$date_today);
                          }
                  }
  }
  </code></pre>