Re: Unexpected behavior of Model::getLastInsertId(); Bug or misunderstanding?

2008-04-17 Thread Joshua McFarren
Hi Tarique, So if I understand correctly, Model::getLastInsertID should do the same thing as SELECT LAST_INSERT_ID(); which only returns an ID if you inserted a row into a table that has auto_increment? http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html Best, Joshua > P.S. looks lik

Re: Unexpected behavior of Model::getLastInsertId(); Bug or misunderstanding?

2008-04-17 Thread Chris Hartjes
On Thu, Apr 17, 2008 at 9:41 AM, Joshua McFarren <[EMAIL PROTECTED]> wrote: > > Is this the expected behavior of the method? The API says, "Returns > the ID of the last record this Model inserted." Am I reading this > wrong? Its it only supposed to return the Id of a CREATE not an > UPDATE? I

Re: Unexpected behavior of Model::getLastInsertId(); Bug or misunderstanding?

2008-04-17 Thread Dr. Tarique Sani
On Thu, Apr 17, 2008 at 7:11 PM, Joshua McFarren <[EMAIL PROTECTED]> wrote: > Is this the expected behavior of the method? The API says, "Returns > the ID of the last record this Model inserted." Am I reading this > wrong? Its it only supposed to return the Id of a CREATE not an > UPDATE? It is

Unexpected behavior of Model::getLastInsertId(); Bug or misunderstanding?

2008-04-17 Thread Joshua McFarren
Hi Adam, Thanks so much, $this->id definitely gives me the right piece of information. I'm still curious though if I'm using Model::getLastInsertId() wrong, or I've stumbled on a bug in the core. Model::getLastInsertId() returns $this->__insertID correctly but it only has a value if a new record