title: Undefined property: stdClass::$title
body: <p>i want to fetch the record from database which pages without parent_id or we can say pages without parent..</p>
  
  <p>the page model
  ..........................................</p>
  
  <pre><code>public function get_no_parents() {
  // fecth pages wihtout parents
  $this-&gt;db-&gt;select ( 'id','title' );
  $this-&gt;db-&gt;where ( 'parent_id', 0 );
  $pages = parent::get ();
  // if there are pages then return key as page-&gt;id and value $page-&gt;title
  $array = array (
  0 =&gt; 'no parent'
  );
  
  if(is_array($pages)){
  
  foreach ($pages as $page){
  
   $array[$page-&gt;id]=$page-&gt;title;
     $return $array;
  
  
      }
    }
  }
  </code></pre>
  
  <p>.....the page controller</p>
  
  <pre><code>$this-&gt;data['pages_no_parents']=$this-&gt;Page_model-&gt;get_no_parents();
      var_dump($this-&gt;data['pages_no_parents']);
  </code></pre>
  
  <p>....
  the dump is null i have two error </p>
  
  <p>1- Undefined property: stdClass::$title</p>
  
  <p>2- Invalid argument supplied for foreach() </p>
  
  <p>can someone help me ? </p>