title: Codeigniter Message: Undefined property: stdClass
body: <p>I'm trying to query the db with the following query in the model:</p>
  
  <pre><code>function showSpecific(){
  
      $all = $this-&gt;session-&gt;all_userdata();
      $name = $all['u_name'];
  
      $id = $this-&gt;db
      -&gt;select('u_id')
      -&gt;from('users')
      -&gt;where('u_name', $name)
      -&gt;get()
      -&gt;row(); 
  
      $id = $id-&gt;u_id; 
  
      $data = $this-&gt;db-&gt;query("SELECT messages.m_id, messages.post_id, messages.m_betreff, messages.an_user, messages.von_user, messages.m_time, users.u_id, users.u_name, posts.p_titel, users.u_id, messages.m_content
                  FROM messages
                  INNER JOIN users 
                  ON messages.von_user=users.u_id
                  INNER JOIN posts
                  ON messages.post_id=posts.post_id
                  WHERE messages.an_user='$id'
                  ORDER BY messages.m_time DESC");
  
  
  
  
      return $data;
  }
  </code></pre>
  
  <p>But when I try to output the result in the view:</p>
  
  <pre><code>&lt;?php foreach ($query-&gt;result() as $row)
                  {
                      echo '&lt;tr&gt;&lt;td&gt;';
                      echo anchor('users/showUser/'.$row-&gt;u_id, $row-&gt;u_name);
                      echo '&lt;/td&gt;&lt;td&gt;';
                      echo $row-&gt;m_betreff;
                      echo '&lt;/td&gt;&lt;td&gt;';
                      echo $row-&gt;m_content;
                      echo '&lt;/td&gt;&lt;td&gt;';
                      echo anchor('posts/showSpecific/'.$row-&gt;post_id, $row-&gt;p_titel);
                      echo '&lt;/td&gt;&lt;td&gt;';
                      echo $row-&gt;m_time;
                      echo '&lt;/td&gt;&lt;/tr&gt;';
                  }
                  ?&gt;
  </code></pre>
  
  <p>Only the m_content gets this error: Why is it the only one? And how do I solve this?</p>
  
  <pre><code>A PHP Error was encountered
  Severity: Notice
  
  Message: Undefined property: stdClass::$m_content
  
  Filename: views/specific_message.php
  
  Line Number: 48
  </code></pre>
  
  <p>Here is my Controller:</p>
  
  <pre><code>function showSpecific(){
  
      $this-&gt;load-&gt;model('messages_model');
      $data['query'] = $this-&gt;messages_model-&gt;getMessages();
  
      $data['main_content'] = 'specific_message';
      $this-&gt;load-&gt;view('includes/login_template', $data);
  }
  </code></pre>
  
  <p>Thanks a lot!</p>