$no = 1; $asked = $this->db->query("SELECT * FROM kuisioner where id_dimensi = '" . $ks['id'] . "'",); foreach ($asked->result_array() as $ask) { ?> <input type="text" name="<?= $this->session->userdata('nama'); ?>" value="<?= $this->session->userdata('nama'); ?>"> <tr> <td bgcolor=#F9EDED align="center"> <font face="Calibri" size="3"><?= $no ?></font> </td> <td bgcolor=#F9EDED> <font face="Calibri" size="3"><?= $ask['pertanyaan'] ?></font> </td> <td bgcolor=#F9EDED align="center"> <input name="p[<?= $ask['id_kuisioner'] ?>]" type="radio" value="1" required> </td> <td bgcolor=#F9EDED align="center"> <input name="p[<?= $ask['id_kuisioner'] ?>]" type="radio" value="2" required> </td> <td bgcolor=#F9EDED align="center"> <input name="p[<?= $ask['id_kuisioner'] ?>]" type="radio" value="3" required> </td> <td bgcolor=#F9EDED align="center"> <input name="p[<?= $ask['id_kuisioner'] ?>]" type="radio" value="4" required> </td> <td bgcolor=#F9EDED align="center"> <input name="i[<?= $ask['id_kuisioner'] ?>]" type="radio" value="1" required> </td> <td bgcolor=#F9EDED align="center"> <input name="i[<?= $ask['id_kuisioner'] ?>]" type="radio" value="2" required> </td> <td bgcolor=#F9EDED align="center"> <input name="i[<?= $ask['id_kuisioner'] ?>]" type="radio" value="3" required> </td> <td bgcolor=#F9EDED align="center"> <input name="i[<?= $ask['id_kuisioner'] ?>]" type="radio" value="4" required> </td> </tr>
sebelumnyya saya buat controller seperti dibawah ini
public function add() { $data = [ 'nama_responden' => $this->input->post('nama'), 'p1' => $this->input->post('p1'), 'p2' => $this->input->post('p2'), 'p3' => $this->input->post('p3'), 'p4' => $this->input->post('p4'), 'p5' => $this->input->post('p5'), 'p6' => $this->input->post('p6'), 'p7' => $this->input->post('p7'), 'p8' => $this->input->post('p8'), 'p9' => $this->input->post('p9'), 'p10' => $this->input->post('p10'), 'p11' => $this->input->post('p11'), 'p12' => $this->input->post('p12'), 'p13' => $this->input->post('p13'), 'p14' => $this->input->post('p14'), 'p15' => $this->input->post('p15'), 'i1' => $this->input->post('i1'), 'i2' => $this->input->post('i2'), 'i3' => $this->input->post('i3'), 'i4' => $this->input->post('i4'), 'i5' => $this->input->post('i5'), 'i6' => $this->input->post('i6'), 'i7' => $this->input->post('i7'), 'i8' => $this->input->post('i8'), 'i9' => $this->input->post('i9'), 'i10' => $this->input->post('i10'), 'i11' => $this->input->post('i11'), 'i12' => $this->input->post('i12'), 'i13' => $this->input->post('i13'), 'i14' => $this->input->post('i14'), 'i15' => $this->input->post('i15') ]; $this->db->insert('respon_kuisioner', $data); $this->session->set_flashdata('message', '<div class="alert alert-success" role="alert"> Jawaban sudah di input </div>'); redirect('responden/dashboard'); } tapi malah pesan errornya database error karena data yang udah input gk kebaca alias null. jadi gimana ya solusi untuk controller nya kawan btw ini saya pake CI3 tolong direspon ya kwn2. program skripsi soalnya wkwk