我无法在我的视图页面中显示多个复选框保存值。这是插入/保存值的详细信息:
模型:
public function saveInstituteOfferdCourse($data = array())
{
if ($this->db->insert('tbl_course_offred', $data))
{
return $this->db->insert_id(); // tbl_course_offred = "Table name"
}
return FALSE;
}
控制器:
public function saveCourses()
{
$data = array();
$this->load->library('form_validation');
$this->form_validation->set_rules('skill', 'skill', 'require');
if ($this->form_validation->run())
{
$skill = implode(',', $this->input->post('skill'));
$data['skill'] = $skill;
$data['user_id'] = $this->session->userdata('user_id');
$this->user_admin_model->saveInstituteOfferdCourse($data);
redirect("user_admin_controller/showInsSkills");
}
}
看法:
<form name="form" method="post" action="tambah">
<input type="checkbox" name="skill[]" value="PHP" >PHP</input
<input type="checkbox" name="skill[]" value="VB.NET" >VB.NET</input
<input type="checkbox" name="skill[]" value="C#" >C#</input
<input type="submit" value="Submit" />
</form>
我想显示如下站点课程的价值。
http://www.yet5.com/training-institute/yet5/5955/coimbatore/mazenet-gandhipuram-at-gandhipuram.html