title: Insert into database using excel from database start from col 2
body: <p>I`m trying to insert data into a database, from an excel file but starting from column 2 because the first column is being used for the name of the row in the table.</p>
  
  <p>This is my form to input the file, this code reads from the first column, I want to start reading from column 2.</p>
  
  <pre><code>&lt;h2&gt;Import Excel File into MySQL Database using PHP&lt;/h2&gt;
      &lt;div class="outer-container"&gt;
          &lt;form action="import.php" method="post"
              name="frmExcelImport" id="frmExcelImport" enctype="multipart/form-data"&gt;
              &lt;div&gt;
                  &lt;label&gt;Choose Excel
                      File&lt;/label&gt; &lt;input type="file" name="file"
                      id="file" accept=".xls,.xlsx"&gt;
                  &lt;button type="submit" id="submit" name="import"
                      class="btn-submit"&gt;Import&lt;/button&gt;
  
              &lt;/div&gt;
  
          &lt;/form&gt;
  
      &lt;/div&gt;
      &lt;div id="response" class="&lt;?php if(!empty($type)) { echo $type . " display-block"; } ?&gt;"&gt;&lt;?php if(!empty($message)) { echo $message; } ?&gt;&lt;/div&gt;
  </code></pre>
  
  <p>and this is the action file:</p>
  
  <pre><code>&lt;?php
  include 'koneksi/koneksi.php';
  require_once('vendor/php-excel-reader/excel_reader2.php');
  require_once('vendor/SpreadsheetReader.php');
  
  if (isset($_POST["import"]))
  {
  
    $allowedFileType = ['application/vnd.ms-excel','text/xls','text/xlsx','application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'];
  
    if(in_array($_FILES["file"]["type"],$allowedFileType)){
  
          $targetPath = 'uploads/'.$_FILES['file']['name'];
          move_uploaded_file($_FILES['file']['tmp_name'], $targetPath);
  
          $Reader = new SpreadsheetReader($targetPath);
  
          $sheetCount = count($Reader-&gt;sheets());
  
          for($i=0;$i&lt;$sheetCount;$i++)
          {
              $Reader-&gt;ChangeSheet($i);
  
              foreach ($Reader as $Row )
              {
  
                  $id_koperasi = "";
                  if(isset($Row[0])) {
                      $id_koperasi = mysqli_real_escape_string($con,$Row[0]);
                  }
  
                  $nama_koperasi = "";
                  if(isset($Row[1])) {
                      $nama_koperasi = mysqli_real_escape_string($con,$Row[1]);
                  }
  
                  $alamat = "";
                  if(isset($Row[2])) {
                      $alamat = mysqli_real_escape_string($con,$Row[2]);
                  }
  
                  $telp = "";
                  if(isset($Row[3])) {
                      $telp = mysqli_real_escape_string($con,$Row[3]);
                  }
  
                  $hp = "";
                  if(isset($Row[4])) {
                      $hp = mysqli_real_escape_string($con,$Row[4]);
                  }
  
                  $nama_cp = "";
                  if(isset($Row[5])) {
                      $nama_cp = mysqli_real_escape_string($con,$Row[5]);
                  }
  
                  $email = "";
                  if(isset($Row[6])) {
                      $email = mysqli_real_escape_string($con,$Row[6]);
                  }
  
                  $tanggal_fu = "";
                  if(isset($Row[7])) {
                      $tanggal_fu = mysqli_real_escape_string($con,$Row[7]);
                  }
  
                  $ket_fu = "";
                  if(isset($Row[8])) {
                      $ket_fu = mysqli_real_escape_string($con,$Row[8]);
                  }
  
                  $hasil_pembahasan = "";
                  if(isset($Row[9])) {
                      $hasil_pembahasan = mysqli_real_escape_string($con,$Row[9]);
                  }
  
                  $status = "";
                  if(isset($Row[10])) {
                      $status = mysqli_real_escape_string($con,$Row[10]);
                  }
  
                  $provinsi = "";
                  if(isset($Row[11])) {
                      $provinsi = mysqli_real_escape_string($con,$Row[11]);
                  }
  
                  $kota = "";
                  if(isset($Row[12])) {
                      $kota = mysqli_real_escape_string($con,$Row[12]);
                  }
  
                  $kec = "";
                  if(isset($Row[13])) {
                      $kec = mysqli_real_escape_string($con,$Row[13]);
                  }
  
                  $kel = "";
                  if(isset($Row[14])) {
                      $kel = mysqli_real_escape_string($con,$Row[14]);
                  }
  
                  $rt = "";
                  if(isset($Row[15])) {
                      $rt = mysqli_real_escape_string($con,$Row[15]);
                  }
  
                  $rw = "";
                  if(isset($Row[16])) {
                      $rw = mysqli_real_escape_string($con,$Row[16]);
                  }
  
                  $jln = "";
                  if(isset($Row[17])) {
                      $jln = mysqli_real_escape_string($con,$Row[17]);
                  }
  
                  $kodep = "";
                  if(isset($Row[18])) {
                      $kodep = mysqli_real_escape_string($con,$Row[18]);
                  }
  
                  if (!empty($id_koperasi) || !empty($nama_koperasi) || !empty($alamat) || !empty($telp) || !empty($hp) || !empty($nama_cp) || !empty($email) || !empty($tanggal_fu) || !empty($ket_fu) || !empty($hasil_pembahasan) || !empty($status) || !empty($provinsi) || !empty($kota) || !empty($kec) || !empty($kel) || !empty($rt) || !empty($rw) || !empty($jln) || !empty($kodep) ) {
                      $query = "INSERT INTO t_koperasi(id,id_koperasi,nama_koperasi,alamat,telp,hp,nama_cp,email,tanggal_fu,ket_fu,hasil_pembahasan,status,provinsi,kota,kec,kel,rt,rw,jln,kodep) VALUES ('',
          '$id_koperasi',
          '$nama_koperasi',
          '$alamat',
          '$telp',
          '$hp',
          '$nama_cp',
          '$email',
          '$tanggal_fu',
          '$ket_fu',
          '$hasil_pembahasan',
          '$status',
          '$provinsi',
          '$kota',
          '$kec',
          '$kel',
          '$rt',
          '$rw',
          '$jln',
          '$kodep')" or die(mysqli_error($con));
      ;
                      $result = mysqli_query($con, $query);
  
                      if (! empty($result)) {
                          $type = "success";
                          $message = "SUKSES";
                      } else {
                          $type = "error";
                          $message = "Problem in Importing Excel Data";
  
                      }
                  }
               }
  
           }
    }
    else
    { 
          $type = "error";
          $message = "Invalid File Type. Upload Excel File.";
    }
  }
  
  include 'views/v_import.php'
  ?&gt;
  </code></pre>
  
  <p>I already tried to put $col = 1 but it still wont work, I tried using the <code>for=i</code>  but it still will not work.</p>