title: Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string
body: <p>I cant get string result of my query....how can i solve it?</p>
  
  <p>Model:</p>
  
  <pre><code>class Get_info extends CI_Model {
  
    function Get_info() {
      parent::__construct(); 
      $this-&gt;load-&gt;database();
  
    }
  
  
    function getFirstName($email){
          $query_id=$this-&gt;db-&gt;query("SELECT user_id FROM user WHERE email='$email'");
          $query=$this-&gt;db-&gt;query("SELECT firstname FROM `user_info` WHERE id='$query_id'");
          var_dump($query-&gt;row());
          return $query-&gt;result();
  
    }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>$email = $this-&gt;input-&gt;post('email');
  $this-&gt;load-&gt;model('get_info'); 
  $result = $this-&gt;get_info-&gt;getFirstName($email);
  $profile = $result[0];
  
  $newdata = array(
          'email' =&gt;  $email,
          'firstname' =&gt; $profile
          );
  $this-&gt;load-&gt;library('session');
  $this-&gt;session-&gt;set_userdata( $newdata );
  </code></pre>
  
  <p>when i call var_dump($query) in modelit answer me like that: <code>object(CI_DB_mysql_result)#23 (8) { ["conn_id"]=&gt; resource(62) of type (mysql link persistent) ["result_id"]=&gt; resource(91) of type (mysql result) ["result_array"]=&gt; array(0) { } ["result_object"]=&gt; array(0) { } ["custom_result_object"]=&gt; array(0) { } ["current_row"]=&gt; int(0) ["num_rows"]=&gt; int(0) ["row_data"]=&gt; NULL }</code></p>
  
  <p>when i call var_dump($profile ) in controller it answer me: <code>array(0) { }</code></p>
  
  <p>Where is my mistake? i am only want get string text from query and put it on data session..</p>