Menu

Save Checkbox Values?

0 votes

Can Anyone Have working Codeigniter Save Checkbox Values?

asked Jan 24 by Devman (590 points)
retagged Jan 24 by Devman

1 Answer

0 votes

After the form validation you can save data

your_controller.php

if ($this->form_validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
$this->your_model->save($data);
}

your_model.php

public function save($data) {
$this->db->set($data);
$this->db->insert(table name here);
$this->db->insert_id();
}
answered Jan 24 by domingez (950 points)

You can find all information related to database class on CI 's great great user guide. It is very easy to use. Please excuse my english :)

Welcome to Ask.CodeIgniter, where you can ask questions and receive answers from other members of the community.
 | Mediacode Theme
Powered by Question2Answer
...