You can also simply use $this->User->id after a create/update as cake retrieves the value automatically anyway.
Cheers, Adam On Mar 8, 3:26 am, "b logica" <[EMAIL PROTECTED]> wrote: > $user_id = $this->User->getLastInsertID(); > > On Fri, Mar 7, 2008 at 7:17 AM, Indian Baker <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm not sure if this has been addressed before.. but this is what I'm > > trying to do using the classic blog example > > > I have a single Form which has the User Registration fields like > > username, name, emial, phone, password etc.. > > and below that I have the fields to Add a New Blog , like title , > > description. > > > Now what I want is once the form is submitted the User info goes into > > the User table first , and then picking up the user id of the record > > just inserted, the data for the Blog gets stored in the blog table. > > > While inserting the 2 different data independently is not a problem, > > I'm not quite sure what is the correct way of getting the id of the > > User record that was just inserted... I mean whats the Cake equivalent > > of mysql_insert_id > > > Thanks in Advance > > IB --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
