Welcome Guest, Not a member yet? Register   Sign In
Best way for checking true result
#2

[eluser]csotelo[/eluser]
If you are going to use flash_data in response, you can save the response in the controller:

Model:
Code:
$data['field1'] = $this->input->post('field1');
$data['field2'] = $this->input->post('field2');
$data['field3'] = $this->input->post('field3');

if ($this->db->insert('table', $data))
{
   $this->session->set_flashdata("insertsuccess", TRUE);
}
else
{
   $this->session->set_flashdata("inserterror", TRUE);
}

Controller:
Code:
if ($this->form_validation->run() == FALSE)
{
    $this->load->view('page_view', $data);
}
else
{
    $this->Model->Insert_data();
    $this->load->view('page_view');
}


Messages In This Thread
Best way for checking true result - by El Forum - 05-07-2012, 09:02 AM
Best way for checking true result - by El Forum - 05-07-2012, 12:17 PM
Best way for checking true result - by El Forum - 05-07-2012, 04:24 PM
Best way for checking true result - by El Forum - 05-07-2012, 08:24 PM
Best way for checking true result - by El Forum - 05-08-2012, 06:14 AM
Best way for checking true result - by El Forum - 05-08-2012, 06:18 AM
Best way for checking true result - by El Forum - 05-08-2012, 06:51 AM
Best way for checking true result - by El Forum - 05-08-2012, 08:56 AM
Best way for checking true result - by El Forum - 05-08-2012, 11:35 AM
Best way for checking true result - by El Forum - 05-27-2012, 10:14 AM
Best way for checking true result - by El Forum - 05-27-2012, 10:28 AM
Best way for checking true result - by El Forum - 07-03-2012, 12:05 PM
Best way for checking true result - by El Forum - 07-26-2012, 11:22 AM
Best way for checking true result - by El Forum - 07-26-2012, 11:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB