title: Codeigniter - Object of class __PHP_Incomplete_Class could not be converted to string
body: <p>I'm getting a <strong>Object of class __PHP_Incomplete_Class could not be converted to string</strong> error when I echo my <strong>is_active</strong> variable, I can work just fine with the username and is_logged_in variable, but not with the is_active variable, I'm wondering what I could be doing wrong here...</p>
  
  <p>On my controller I did:</p>
  
  <pre><code>$username=$this-&gt;input-&gt;post("username");
              $activated_val=$this-&gt;membership_model-&gt;is_activated($username);
  
              $data = array(
                  "username" =&gt; $this-&gt;input-&gt;post("username"),
                  "is_logged_in" =&gt; true,
                  "is_active" =&gt; $activated_val
              );
              $this-&gt;session-&gt;set_userdata($data);
              redirect("main");
  </code></pre>
  
  <p>My model function:</p>
  
  <pre><code>function is_activated($username){
          $query = "SELECT activated FROM members WHERE username=?";
          $result = $this-&gt;db-&gt;query($query, $username);
  
          return $result;
      }
  </code></pre>
  
  <p>And in my view:</p>
  
  <pre><code>$is_active= $this-&gt;session-&gt;userdata("is_active");
                  echo $is_active;
  </code></pre>