title: cakephp: notice 8:undefined index: id error
body: <p>i'm getting Undefined index: id [APP\controllers\merry_parents_controller.php, line 31]Code           </p>
  
  <pre><code>debug($this-&gt;data['MerryParent']);
      echo 'id: '.$this-&gt;data['MerryParent']['id'];
  
   MerryParentsController::login() - APP\controllers\merry_parents_controller.php, line 31
   Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
   Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
   [main] - APP\webroot\index.php, line 83
  </code></pre>
  
  <p>My code:</p>
  
  <p>merry_parents_controller.php</p>
  
  <pre><code>if ($this-&gt;Auth-&gt;user()){
              //debug($this-&gt;Auth-&gt;user());
              $this-&gt;data['MerryParent']=$this-&gt;Auth-&gt;user();
              debug($this-&gt;data['MerryParent']);
              echo 'id: '.$this-&gt;data['MerryParent']['id'];
  </code></pre>
  
  <p>for debug($this->data['MerryParent']), the record is displaying fine:</p>
  
  <pre><code>Array
   (
    [MerryParent] =&gt; Array
      (
      [id] =&gt; 2
      [initial] =&gt; Ms
      [username] =&gt; hong
      [email] =&gt; hong7@yahoo.com
      [password2] =&gt; hong7
      [landline] =&gt; 
      [mobile] =&gt; 293472389472
      [address] =&gt; dsaflkjasdlfk
      [state_id] =&gt; 5
      [city_id] =&gt; 62
      [postal_code] =&gt; 825729
      [created] =&gt; 2011-08-02 10:29:59
      [modified] =&gt; 2011-09-26 06:42:27
       )
  )
  </code></pre>
  
  <p>but when i try 
  echo 'id: '.$this->data['MerryParent']['id'];</p>
  
  <p>i'm getting notice 8: undefined index error. I have no idea on what is the problem. Can someone please help me?</p>