Hi,I can't display Multiple checkbox save value in my veiw page.
Here is insert/save value details:

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->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');
<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" />


I want display value like below site courses.please check the site and give me idea or code.it is very urgent hope anybody help me.
Click Here
please help me master...



Although I am not a master NOR I am close to becoming one and I have not seen codeIgniter for a while, I am still familiar with the basic syntax of this framework..

Before getting into this question, please allow me to ask you this..

on your controller file, did you add the load view method? example

$this->load->view('this_form', $data);

If so, on your view file called 'this_form.php', you must loop through the $data array, because it is defined as an array in your controller file..

** WARNING! codes are not tested. Please use as guidelines only if applicable.** For example,

<!-- filename: this_form.php -->
foreach($data as $item){

   echo '<input type="checkbox" value="'.$item.'">'. $item ;

  <!-- add more form items here -->

In CI, you can also do this. If you can modify your codes above to something similar to this, it will be a lot easier for you to assign the values for skill as demonstraed by item1 array.

    $data = array(

            'item1' => array('item1a'=>'item1a1','item1b'=>'item1b1'),
            ## let me use data from your codes above.
            'item2' => $this->session->userdata('user_id')

It is highly recommended to pass the data in this manner. By adhering to this recommendation, it will be so much easier to implement templating engine in the near future.

I think ??? CI also allows you to do this..

    public function your_function(){

    $data = array();

    return $data;



     $this->load->view('this_form', $this->your_function());

if it does, then my sample codes above is pretty nice and clean, and at the same time it is a template engine friendly .

ADDED INFO: If you are interested in twig templating engine for CI, you can download the repo here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.