What if I made the insert 20 days ago, how could I get the last id?

I want to get the current ID value in the beforeSave function to apend
it to a file I'm saving... Any thouhts?


kevando


On Oct 25, 11:17 pm, "Larry E. Masters" <php...@gmail.com> wrote:
> $this->Model->save();
> $id = $this->Model->id;
>
> --
> Larry E. Masters
>
>
>
>
>
>
>
> On Mon, Oct 25, 2010 at 11:14 PM, cricket <zijn.digi...@gmail.com> wrote:
> > On Mon, Oct 25, 2010 at 11:51 PM, Robert J. Maiolo <rmai...@gmail.com>
> > wrote:
>
> > > after your save statement..
>
> > > $var = $this->Contact->lastInsertId();
>
> > It's getInsertID(). You're probably thinking of getLastInsertID(),
> > which has been deprecated.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd 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 cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.c 
> > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to