title: Column 'id' in where clause is ambiguous in codeigniter
body: <p>I want to join two tables in codeigniter. I want to display data according to login user.I do it getting session id of user.it display error message which I mention on heading.when i comment " <code>$this-&gt;db-&gt;where("id",$this-&gt;session-&gt;userdata['logged_in']['id']);"</code> this part it will work fine.</p>
  
  <p><strong>model</strong> </p>
  
  <pre><code>function get_user(){
  
      $this-&gt;db-&gt;select("user.firstname,user.lastname,user.address, user.email, user.contact_no, project.location"); 
      $this-&gt;db-&gt;where("id",$this-&gt;session-&gt;userdata['logged_in']['id']); //check login user
      $this-&gt;db-&gt;from('user');
       $this-&gt;db-&gt;join('project', 'project.client_id = user.id');
      $query = $this-&gt;db-&gt;get();
      return $query-&gt;result();
  </code></pre>
  
  <p><strong>controller</strong></p>
  
  <pre><code>public function index(){  
  
   $data['post'] = $this-&gt;profile_model-&gt;get_user(); // calling Post model method getPosts() 
          $this-&gt;load-&gt;view('user_include/header');
          $this-&gt;load-&gt;view('user_site/profile',$data);
      }
  </code></pre>
  
  <p><strong>view</strong></p>
  
  <pre><code>&lt;?php if($post) { ?&gt; 
  &lt;?php foreach($post as $post){?&gt; 
  
      &lt;div&gt;&lt;?php echo $post-&gt;firstname ; echo '&amp;nbsp; &amp;nbsp;'; echo $post-&gt;lastname;?&gt;&lt;/div&gt; &lt;br&gt;
      &lt;div&gt;&lt;?php echo $post-&gt;address ; echo '&amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;'?&gt;&lt;/div&gt;&lt;br&gt;
      &lt;div&gt;&lt;?php echo $post-&gt;contact_no ; echo '&amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;'?&gt;&lt;/div&gt; &lt;br&gt;
      &lt;div&gt;&lt;?php echo $post-&gt;email ; echo '&amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;'?&gt;&lt;/div&gt; &lt;br&gt;
      &lt;div&gt;&lt;?php echo $post-&gt;location ; echo '&amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;  &amp;nbsp;'?&gt;&lt;/div&gt; &lt;br&gt;
  
  &lt;?php } 
  } else {
  
      ?&gt; 
   &lt;/div&gt;
  &lt;div clospan="4" align="center"&gt;No records found to display&lt;/div&gt;
  </code></pre>