Postingan lainnya
Loopping dan insert ke database codeigniter
Saya ingin looping saya input ke database, //FORM VIEW
<?php for($i=$d; $i<=$s; $i++):?>
<tr>
<td>ayat</td>
<td><input type="checkbox" class="form-check-input" name="p[]" value="<?php echo $i.'p'; ?>"><?php echo $i.'p'; ?></td>
<td><input type="checkbox" class="form-check-input" name="k[]" value="<?php echo $i.'k'; ?>"><?php echo $i.'k'; ?></td>
</tr>
<?php endfor; ?>
//CONTROLLER
public function input_nilai_uji(){
$p = $this->input->post('p');
$k = $this->input->post('k');
$data = array(
'p' => implode(',', $this->input->post('tes',TRUE)),
'k' => implode(',', $this->input->post('tes',TRUE))
);
$this->m_uji->input_data($data,'uji');
echo "berhasil";
}
0
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban