On Nov 4, 3:50 pm, "Mike Karthauser" <[email protected]> wrote:
> On Wed, November 3, 2010 7:05 pm, kevando wrote:
>
> > What about if my last insert/save was 20 days ago?

why don't you insert and then update if you want to do that. you can
easily wrap that in a transaction. anything else you do just risks a
race condition.

>
> > Basically -- I want to get the value of the current (or latest) id in the
> > beforeSave function
>
> $this->Model->getLastInsertId();
>
> http://book.cakephp.org/view/312/Models
>
> does what it says on the can.

which is "return null" unless you just inserted something.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to