Insert iteration data into database
<p>i'm using codeigniter.I want to insert data in every iteration to database.</p>

<p><strong>controller</strong></p>

<pre><code> $fee=500;
 $trans_fee=300;
 $ins_arr=array(2,3);
 $ins_array_count=count($ins_arr) ; 

 if(!in_array('1', $ins_arr))
 {
   for($i=0;$i&lt;$ins_array_count;$i++)
   {
      $ins.'_'.$ins_arr[$i]= ($fee+$trans_fee);  
       $ins_sum+= $ins_.$ins_arr[$i];

    }

  }
</code></pre>

<p>i want to get the data inside this variable like( <code>$ins_2</code> and <code>$ins_3</code>) and insert the value of <code>$ins_2</code> and <code>$ins_3</code> into db</p>

<p>I got value of  <code>$ins_sum</code> correctly</p>

<p>Anyone please answer me</p>