title: Codeigniter error Message: Undefined property: stdClass::$members_id
body: <p>I got this error message when running PHP Code Igniter project:</p>
  
  <blockquote>
    <p>A PHP Error was encountered</p>
    
    <p>Severity: Notice</p>
    
    <p>Message: Undefined property: stdClass::$members_id</p>
    
    <p>Filename: models/mtree.php</p>
    
    <p>Line Number: 33</p>
  </blockquote>
  
  <p>In line 33 <code>($row-&gt;members_id)</code> refer to field in my database </p>
  
  <pre><code>VALUES (" . $this-&gt;db-&gt;escape($row-&gt;members_id) . ", " . $this-&gt;db-&gt;escape($left_parent) . ")";
  </code></pre>
  
  <p>My model function is:</p>
  
  <pre><code>function insert_to_right($direct_id='members_direct_id') {
          $left_parent = $this-&gt;get_right_parent('members_id');
          $row-&gt;members_direct_id = $left_parent;
          $row-&gt;members_spillover_id = $left_parent;
          $this-&gt;db-&gt;insert('ajmatrix_members_table', $row);
          $sql = "INSERT INTO ayman_mot (child, parent)
          VALUES (" . $this-&gt;db-&gt;escape($row-&gt;members_id) . ", " . $this-&gt;db-&gt;escape($left_parent) . ")";
          $this-&gt;db-&gt;query($sql);
      }
  </code></pre>