title: i am not able to update in database using php codeigniter
body: <p>i am new to code igniter i am not able to resolve this problem please help me
  below code is in   </p>
  
  <blockquote>
    <p>select.php in model</p>
  </blockquote>
  
  <pre><code>//     update for selected data
  public function update_analytics_id1()
      {
      $this-&gt;db-&gt;where('google_analytics', $id);
      $this-&gt;db-&gt;update('seo', $data);
  
  }
  
  public function show_all_analytics(){
      $query = $this-&gt;db-&gt;get('seo');
      $query_result = $query-&gt;result();
      return $query_result;
  }
  //single data fetch
  public function show_single_id{
      this-&gt;db-&gt;select('*');
      $this-&gt;db-&gt;from('seo');
      $this-&gt;db-&gt;where('google_analytics', $data);
      $query = $this-&gt;db-&gt;get();
      $result = $query-&gt;result();
      return $result;
  
  }
  </code></pre>
  
  <blockquote>
    <p>user_authentication.php is controller</p>
  </blockquote>
  
  <pre><code> public function update(){  
      $id= $this-&gt;input-&gt;post('did');
      $data = array('a_analytics' =&gt;$this-&gt;input-&gt;post('analytics') );
      $this-&gt;load-&gt;model('select');
                    //update query
      $this-&gt;select-&gt;update_analytics_id1($id,$data);
      $this-&gt;show_analytics_id();
  }
  
  public function show_analytics_id(){
      $this-&gt;load-&gt;model('select');
      $id = $this-&gt;uri-&gt;segment(2);
      $data['seo'] = $this-&gt;select-&gt;show_all_analytics();
      $data['single_entry'] = $this-&gt;select-&gt;show_single_id($id);
      $this-&gt;load-&gt;view('showdata', $data);
  }
  </code></pre>
  
  <blockquote>
    <p>showdata is my view page</p>
  </blockquote>
  
  <pre><code> &lt;?php include 'header.php'; ?&gt;
  
          &lt;!-- Fetching All Details of Selected data From Database And Showing In a Form --&gt;
          &lt;?php foreach ($seo as $single_entrys): ?&gt;
      &lt;div class="form"&gt;
          &lt;form action="&lt;?php echo base_url ('User_Authentication/update'); ?&gt;" method="post"&gt;
              &lt;input type="text" id="hide" name="did" value="&lt;?php echo $id-&gt;id; ?&gt;"&gt;
              &lt;label&gt;GOOGLE ANALYTICS&lt;/label&gt;
                  &lt;textarea name="analytics" id="google"&gt;
                     &lt;?php echo $seo-&gt;google_analytics; ?&gt;                    
                  &lt;/textarea&gt;
              &lt;input type="submit" name="submit" value="add"&gt;
          &lt;/form&gt;  
      &lt;/div&gt;   
  </code></pre>
  
   
  
  <p>*when ever i try to run il get A PHP Error was encountered</p>
  
  <p>Severity: Notice</p>
  
  <p>Message: Undefined variable: seo</p>
  
  <p>Filename: views/showdata.php</p>
  
  <p>Line Number: 4</p>
  
  <p>Backtrace:*</p>