title: Object of class stdClass could not be converted to string in codeigniter
body: <p>there are two sample here,</p>
  
  <p>1.</p>
  
  <p>in controller</p>
  
  <pre><code> $result_article = $this-&gt;cms-&gt;get_content($event_id);
   if($result_article-&gt;num_rows() == 1){
   $data['row'] = $result_article-&gt;row();
  }
  </code></pre>
  
  <p>in my view</p>
  
  <pre><code>&lt;?php echo $row-&gt;title; ?&gt;
  </code></pre>
  
  <p>print_r($row)/print_r($result_article->row()); output</p>
  
  <pre><code>stdClass Object ( [id] =&gt; 43 [title] =&gt; Grant visit by Prime Minister [content] =&gt; this is the content [create_date] =&gt; 2012-09-21 [last_update] =&gt; 2012-09-22 19:27:12 )
  </code></pre>
  
  <p>with error appeared </p>
  
  <pre><code>A PHP Error was encountered
  Severity: 4096
  Message: Object of class stdClass could not be converted to string
  Filename: libraries/Parser.php
  Line Number: 101
  </code></pre>
  
  <p>2.</p>
  
  <p>in controller</p>
  
  <pre><code>$result_article = $this-&gt;cms-&gt;get_content($event_id);
  
                      if($result_article-&gt;num_rows() == 1){
                          $row = $result_article-&gt;row();
  
                            $data = array(
                               'title' =&gt; $row-&gt;title
                            );
  }
  </code></pre>
  
  <p>in my view </p>
  
  <pre><code>&lt;?php echo $title; ?&gt;
  </code></pre>
  
  <p>print_r($title) output</p>
  
  <pre><code>Grant visit by Prime Minister
  </code></pre>
  
  <p>no error.</p>
  
  <p>what is the different between the 1st controller and 2nd code, it suppose to be the same output right? i am confused！ </p>
  
  <p>to make it more clear, i have simplified the code</p>
  
  <p>here is the model</p>
  
  <pre><code>function get_content($event_id){
       $this-&gt;db-&gt;select('id,title,content,create_date,last_update');
       $query = $this-&gt;db-&gt;get_where('events',array('id' =&gt; $event_id));
       return $query;
  }
  </code></pre>
  
  <p>the controller </p>
  
  <pre><code>$data['query']  = $this-&gt;cms-&gt;get_content($this-&gt;uri-&gt;segment(3));
  
  if($data['query']-&gt;num_rows() == 1){
  $row = $data['query']-&gt;row();
  
  &lt;!--with this code, no error appear--&gt;
  $data = array(
  'title' =&gt; $row-&gt;title,
  'content' =&gt; $row-&gt;content,
  'create_date' =&gt; $row-&gt;create_date,
  'last_update' =&gt; $row-&gt;last_update,
  'event_id' =&gt; $row-&gt;id
                );
  &lt;!--with this code, no error appear--&gt; 
  </code></pre>
  
  <p>if is only these code</p>
  
  <pre><code>$data['query']  = $this-&gt;cms-&gt;get_content($this-&gt;uri-&gt;segment(3));
  
      if($data['query']-&gt;num_rows() == 1){
      $row = $data['query']-&gt;row();
  </code></pre>
  
  <p>error happen,</p>
  
  <pre><code>A PHP Error was encountered
  Severity: 4096
  Message: Object of class CI_DB_mysql_result could not be converted to string
  Filename: libraries/Parser.php
  Line Number: 101
  </code></pre>