android - how to insert multiple check box in web service codeigniter? -


i've created web service in codeigniter. here controller:

public function insertsebab(){      $id=$this->input->post('id_konsultasi');     $sebab=$this->input->post('kd_sebab');      $data = array(         'id_konsultasi'     =>$id,         'kd_sebab'      => $sebab,      );      $konsultasi = $this->class_model->insertsebab($data);     if(count($konsultasi) > 0 ){         $json["status"] = "success";         $json["message"] = "data berhasil di simpan";         $json["data"] = (object) array();      }     else{         $json["status"] = "gagal";         $json["message"] = "no data found in database";         $json["data"] = (object) array();     }     echo json_encode($json); } 

the code above explains how insert data more 1 in checkbox,but data save one. checkbox

so,how create insert multiple check box in web service codeigniter?

i think u need foreach post name. here same question : get multiple values of checkbox in codeigniter

i wish helps you.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -