title: cakephp getLastInsertID()
body: <p>This code:<br>
      <pre><code>foreach ($arrays as $array){
      $this->Model->set('bla', $array['key1']);
      $this->Model->set('alb', $array['key2']);
      $this->Model->save();
      echo $this->Model->getLastInsertID() . ",";
  }</code></pre></p>
  
  <p>returns:
      <pre><code>2,2</code></pre></p>
  
  <p>should return:
      <pre><code>1,2</code></pre></p>
  
  <p>I tried using
      <pre><code>foreach ($arrays as $array){
      $this->Model->query('insert....');
      $this->Model->query('select last_insert_id()')
      }</pre></code></p>
  
  <p>but that returned "1,1"...
  So what I'm doing wrong??</p>