I'm working on a CakePHP script running from the command-line. I'm attempting to check for a record in table "foo", and if it doesn't exist, I add a new record using the Model::save() method. Afterwards, I immediately call Model::field() to try to capture the auto_incremented "id" field so that I can do extra work relating to that record.
Problem is, when I call $this->controller->Foo->field( 'id', $conditions ); immediately after the save, it returns null. In fact, this happens every time for that record until the script has completed and is run a second time. I'm used to running scripts in Perl or TCL where when you make a database call, it completes immediately, so I'm confused by what seems to be some kind of caching of the data here. I can't seem to find any kind of flush() method to complete allow all of these things to be refreshed. Obviously I'm VERY new to CakePHP. Any insight here would be greatly appreciated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
