title: array defult value insert not proper insert data?
body: <p>I am using CodeIgniter insert array value issue first array value insert fine but multiple value not insert proper so please share valuable idea sir. i am share all issue code here...</p>
  <p><strong>CodeIgniter models</strong></p>
  <pre><code>  public function savemedicine()
          {
              $db2 = $this-&gt;load-&gt;database('dpr',TRUE);
  
              $medicine_typer = array(&quot;CAB&quot;, &quot;TAB&quot;, &quot;CAB&quot;,&quot;CAB&quot;);
              $pricer = array(&quot;202&quot;, &quot;100&quot;, &quot;97&quot;,&quot;92&quot;);
              $quantityr = array(&quot;2&quot;,&quot;2&quot;,&quot;1&quot;,&quot;3&quot;);
             
      
             foreach ($item_namer as $key =&gt; $value){
      
                    //print_r($medicine_typer[$key]);//output CABA
                    //print_r($quantityr[$key]);//output 2
                    //print_r($pricer[$key]);//output 2020
      
                  $medicine_typer         =$medicine_typer[$key];
                  $quantityr              =$quantityr[$key];
                  $pricer                 =$pricer[$key];
              
          $db2-&gt;query('INSERT INTO dpr_medicine_return(medicine_type,quantity,price)
              VALUES (&quot;'.$medicine_typer.'&quot;,&quot;'.$quantityr.'&quot;,&quot;'.$pricer.'&quot;)');
                  
               $i++;       
              }
      }
  </code></pre>