title: How to show userdata from tank_auth in codeigniter?
body: <p>What is the right way to get all the data from the 'users' table in my database, using Tank Auth?</p>
  
  <p>I tried it with just with <code>$this-&gt;db-&gt;get('users');</code> </p>
  
  <p>But how do i get the data for the specific logged-in user?
  Do I have to use <code>$this-&gt;tank_auth-&gt;get_user_id();</code>?</p>
  
  <p>Here's what I've tried:</p>
  
  <pre><code>function get_user_data()
  {
      $id = $this-&gt;tank_auth-&gt;get_user_id();
      $this-&gt;db-&gt;where('id', $id);
      $users = $this-&gt;db-&gt;get('users');
  
      return $users-&gt;result();
  }
  </code></pre>
  
  <p>I hope somebody can help me out with this.</p>