Hi all,
i am just new to codignitor. i am tyring the delete records lesson from a table using non ajax. my problem is, after deleting the record, the page loads again correctly. but the deleted record is still showing up. i have to refresh manually the page again one more time to get a fresh copy.
Controller code related to view and delete records are given below.
public function view() {
//load the database
$this->load->database();
//load the model
$this->load->model('Customers_model');
//load the method of model
$data['h']=$this->Customers_model->view();
//return the data in view
$this->load->view('header');
$this->load->view('customers/view', $data);
$this->load->view('footer');
}
public function delete() {
$customer_id=$this->uri->segment(3);
$this->load->model('Customers_model');
$this->Customers_model->delete($customer_id);
//redirect(base_url() . "index.php/customers/view", "refresh");
redirect("customers/view");
}