I would look into the afterSave model function. Just a guess, but you'll probably need to do a find on the tmp table (perhaps into a variable called $tmp_results), then do a $this->Attachment->saveAll($tmp_results) and finally a deleteAll on AttachmentTmp.
Jeremy Burns Class Outfit [email protected] http://www.classoutfit.com On 15 Sep 2010, at 09:56, Tomfox Wiranata wrote: > Hi, > > I have a table in my database that stores information temporarily, > during a page creation process. > > table :attachment_tmps > attributes: id, product_id, name, path, size, attachment > > when the user hits finally the "save" button i want to write the > information from the tmp table to the real one, "attachments" > > I guess with naked SQL It would look like this: > > insert into attachments (column1, column2, …, columnX) as > select column1, column2, …, columnX from attachment_tmps > where product_id="123" and attachment="1"; > > > so far i dont know how to do this with cake. > > thanks a lot :) > > 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 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
