Welcome Guest, Not a member yet? Register   Sign In
A view or another HELP PLEASE
#1

[eluser]Unknown[/eluser]
Hi all i am a newbie in codeigniter and i started a little project as basic training, but i have a problem i have a controller and a method in that controller how can swich between two views. To be more explicit i will paste the code because all i'm getting are two vies loaded:


function update(){
//i want to execute this
$this->load->model('users_model');
$data_1['users'] = $this->users_model->getUsers();
$this->load->model('cars_model');
$data_2['cars'] = $this->cars_model->getCars();
$data = array_merge($data_1,$data_2);
$this->load->view('updateCars', $data );
$id = $this->input->post('id');

$Make = $this->input->post('Make');
$Year = $this->input->post('Year');
$Price= $this->input->post('Price');
$Description = $this->input->post('Description');
$this->db->query("UPDATE cars SET Make='$Make',Year='$Year',Price='$Price',Description='$Description' where id='$id';") ;
//and then this but the 'updateCars' view remains when i load the new page so i want to do all these instructions and after they execute to load this last view alone whitout the previous one

$this->load->view('loggedin');

}


Any help is apreciatedBig Grin




Theme © iAndrew 2016 - Forum software by © MyBB