title: Codeigniter POST Multiple Selectbox
body: <p>I couldn't post multiple selectbox values properly. My code are below;</p>
  
  <p>View</p>
  
  <pre><code>&lt;form class="form-horizontal tasi-form" method="post" action="&lt;?php echo site_url('uye/ekle/paket_ekle'); ?&gt;"&gt;
  &lt;select multiple="multiple" class="form-control" name="makaleler[]"&gt;
  &lt;?php foreach($makaleler as $m) { ?&gt;
  &lt;option value="&lt;?php echo $m['id']; ?&gt;"&gt;&lt;?php echo $m['isim']; ?&gt;&lt;/option&gt;
  &lt;?php } ?&gt;&lt;/select&gt;
  </code></pre>
  
  <p>Controller</p>
  
  <pre><code>function paket_ekle() {
  
      $this -&gt; form_validation -&gt; set_rules('fiyat', 'Fiyat', 'required|numeric');
      if ($this -&gt; form_validation -&gt; run() === FALSE) {
          $this -&gt; paket();
  
  
      } else {
          if ($this -&gt; M_ekle -&gt; paket_ekle()) {
              $this -&gt; session -&gt; set_flashdata('ok', 'Paketiniz yönetici onayına gönderildi!');
              redirect('uye/ekle/paket');
          } else {
              $this -&gt; session -&gt; set_flashdata('hata', 'Bir hata oluştu. Lütfen tekrar deneyin.');
              redirect('uye/ekle/paket');
          }
      }
  }
  </code></pre>
  
  <p>Model</p>
  
  <pre><code>function paket_ekle()
  {
  
      foreach($this-&gt;input-&gt;post('makaleler') as $mak){
  
      $data = array
                  (
                  'makaleler'             =&gt; $mak,
                  'fiyat'                 =&gt; $this-&gt;input-&gt;post('fiyat'),
                  'yazar'                 =&gt; $this-&gt;session-&gt;userdata('id'),
  
                  );
       }
      if($this-&gt;db-&gt;insert('paketler', $data))
      {
          return true;
      }
      else
      {
          return false;
      }
  }
  </code></pre>
  
  <p>I found a few questions like this here but I couldn't solve it. So, I'm sorry for re-asking this.</p>
  
  <p>Thanks in advance.</p>