title: insert radio value multiple data codeigniter in database to one row?
body: <p>I have a quiz online project i want the answer save like this in database </p>
  
  <pre><code>+-----------+-------------+---------+-------------+
  | id_answer | id_student  | id_kuis |   answer    |
  +-----------+-------------+---------+-------------+
  |         1 | 99999874465 |       7 | A,B,D,A,C,B |
  +-----------+-------------+---------+-------------+
  </code></pre>
  
  <p>this quiz is multiple choice. So how can i insert the data of answer like that.</p>
  
  <p>here's my view </p>
  
  <pre><code> &lt;?php echo form_open('c_kuis/addKuisAnswer',$atribut); ?&gt;
                          &lt;?php foreach($soalPG as $row){?&gt;
                          &lt;?php $jawab_array = array($row-&gt;pil_a,$row-&gt;pil_b,$row-&gt;pil_c,$row-&gt;pil_d);?&gt;
                          &lt;p&gt;&lt;?=$row-&gt;no_soal?&gt;.&lt;?=$row-&gt;soal?&gt;&lt;/p&gt;
                          &lt;input type="hidden"name="id_soal&lt;?=$row-&gt;id_soal_pg?&gt;" value="&lt;?=$row-&gt;id_soal_pg?&gt;"&gt;&lt;/input&gt;
                          &lt;input type="radio" name="jawaban&lt;?=$row-&gt;no_soal?&gt;" value="A"&gt; A. &lt;?=$jawab_array[0]?&gt;&lt;/input&gt;&lt;br&gt;
                          &lt;input type="radio" name="jawaban&lt;?=$row-&gt;no_soal?&gt;" value="B"&gt; B. &lt;?=$jawab_array[1]?&gt;&lt;/input&gt;&lt;br&gt;
                          &lt;input type="radio" name="jawaban&lt;?=$row-&gt;no_soal?&gt;" value="C"&gt; C. &lt;?=$jawab_array[2]?&gt;&lt;/input&gt;&lt;br&gt;
                          &lt;input type="radio" name="jawaban&lt;?=$row-&gt;no_soal?&gt;" value="D"&gt; D. &lt;?=$jawab_array[3]?&gt;&lt;/input&gt;&lt;br&gt;
                          &lt;br&gt;&lt;br&gt;
                      &lt;?php } ?&gt;
                      &lt;input type="hidden" name="kuis_id" value="&lt;?php echo $kuisPG-&gt;id_ks;?&gt;"&gt;&lt;/input&gt;
                      &lt;button class="btn btn-primary submit" id= "submit" type="submit"&gt;Submit&lt;/button&gt;
                      &lt;?php echo form_close(); ?&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>and here's my controller </p>
  
  <pre><code>public function addKuisAnswer(){
          $kuis_id = $_POST['kuis_id'];
          $id_user = $this-&gt;session-&gt;userdata('data_user')-&gt;no_id;
          $i=1;
          while(isset($_POST['jawaban'.$i]))
           {
              $answer = $_POST['jawaban'.$i];
           }
          $this-&gt;load-&gt;model('m_kuis');
          $this-&gt;m_kuis-&gt;answer_PG($id_user,$kuis_id,$answer);
           echo " &lt;script&gt;
                          alert('answer saved!');
                          history.go(-2);
                          &lt;/script&gt;"; 
  
      }
  </code></pre>
  
  <p>How can i edit my controller to input data as the example table above?</p>