This should do the trick:

public function bla()
{
        $lastPost = $this->Post->find('first', array('order' =>
array('Post.id DESC'), 'limit' => '1'));
}

Cya!

On 11 maio, 09:42, Andrei Mita <andrei.m...@gmail.com> wrote:
> Do you want to edit the last row or the last inserted row?
>
>
>
> On Tue, May 11, 2010 at 3:00 PM, Jeremy Burns <jeremybu...@me.com> wrote:
> > Do a find first sorted by id desc, then do a straightforward edit.
>
> > Something like should get the last row:
>
> > $row = $this->Model->find(
> >        'first',
> >        array(
> >                'order' => array('Model.id DESC')
> >                'recursive' => -1
> >        )
> > );
>
> > Jeremy Burns
> > jeremybu...@me.com
> > On 11 May 2010, at 12:52, Master Ram wrote:
>
> > > hi.. all i want edit last row in the table.... how to do. if possible
> > > send a sample code..
>
> > > thank
>
> > > 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.com>For
> > >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> > 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.com>For
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> 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 For more options, visit this group 
> athttp://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