title: Object of class stdClass could not be converted to string
body: <p>I am having a problem with PHP at the moment, I am getting this error, </p>
  
  <p><code>Object of class stdClass could not be converted to string</code> the error occurs when I run this portion of code in my site, </p>
  
  <pre><code>function myaccount() {
      $data['user_data'] = $this-&gt;auth-&gt;get_userdata($this-&gt;uri-&gt;segment(3));
      //var_dump($data['user_data']);
      $this-&gt;load-&gt;model('users_model');
      $data['user_info'] = $this-&gt;users_model-&gt;get_user_and_roadmaps_by_id($this-&gt;uri-&gt;segment(3));
      $this-&gt;template-&gt;build('users/my_account', $data);
  }
  </code></pre>
  
  <p>The line in which the error is occuring is this one, </p>
  
  <pre><code>$data['user_data'] = $this-&gt;auth-&gt;get_userdata($this-&gt;uri-&gt;segment(3));
  </code></pre>
  
  <p>And this line is calling this function, </p>
  
  <pre><code>   function get_userdata() {
  
          $CI =&amp; get_instance();
  
          if(!$this-&gt;logged_in()) {
              return false;
          } else {
              $query = $CI-&gt;db-&gt;get_where('users', array('user_id' =&gt; $CI-&gt;session-&gt;userdata('user_id')));
              return $query-&gt;row();
          }
      }
  </code></pre>
  
  <p>I don't really now what this problem is, so any help would be great.</p>