i am not able to update in database using php codeigniter
i am new to code igniter i am not able to resolve this problem please help me below code is in
select.php in model
// update for selected data
public function update_analytics_id1()
{
$this->db->where('google_analytics', $id);
$this->db->update('seo', $data);
}
public function show_all_analytics(){
$query = $this->db->get('seo');
$query_result = $query->result();
return $query_result;
}
//single data fetch
public function show_single_id{
this->db->select('*');
$this->db->from('seo');
$this->db->where('google_analytics', $data);
$query = $this->db->get();
$result = $query->result();
return $result;
}
user_authentication.php is controller
public function update(){
$id= $this->input->post('did');
$data = array('a_analytics' =>$this->input->post('analytics') );
$this->load->model('select');
//update query
$this->select->update_analytics_id1($id,$data);
$this->show_analytics_id();
}
public function show_analytics_id(){
$this->load->model('select');
$id = $this->uri->segment(2);
$data['seo'] = $this->select->show_all_analytics();
$data['single_entry'] = $this->select->show_single_id($id);
$this->load->view('showdata', $data);
}
showdata is my view page
*when ever i try to run il get A PHP Error was encountered
Severity: Notice
Message: Undefined variable: seo
Filename: views/showdata.php
Line Number: 4
Backtrace:*