I am working on CI 3 when I post form data and insert into database then form a value that has been successfully save and I am also getting the last insert through $insert_id = $this->db->insert_id() following example as mention below:
$data = array(
'name' => $this->input->post('name'),
'email' => $this->input->post('email'),
'password' => sha1($this->input->post('cpassword')),
'confirm_id' => sha1($this->input->post('email')),
'created_at' => date('Y-m-d H:i:s')
);
$success = $this->db->insert('instructor', $data);
$insert_id = $this->db->insert_id($success);
if($success == true)
{
$instructorData = $this->instructor_m->get_instructorData($insert_id);
$this->session->set_userdata('InstloginuserId',$instructorData->instructorID);
redirect(base_url('board'));
}
else
{
$this->session->set_flashdata('message', $this->lang->line('fail'));
redirect(base_url('register'));
}
If success condition is true then it redirects to board page but it throws status code: 303 I don't know why? Please help me to solve this.
