Hi all,
I'm surprised by $this->getID() behavior when I call $this->save() in
a loop...
Actually, $this->getID() returns always the same number!?
My code:
for ($i=1;$i<=$max;$i++) {
$new_tag = array('name'=>$data['Item']['Tag'.$i], 'slug'=>$slug,
'insertion'=>1);
$this->save($new_tag,false);
$new_id = $this->getID();
echo "new_id : ".$new_id."<br />";
}
For each loop step, "new_id" is always the first new id...
Of course, all my save's calls are Mysql "INSERT", not UPDATE...
Any idea?
I'm using Cake 1.2 nightly builds.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---