Basically, if the data you're saving has an id (or whatever the
primary key of the model is), then the code will execute an update
statement. Otherwise, it'll insert. You don't need to check
beforehand, in other words, since the Cake code will determine from
the data passed whether it should update or insert.

Nancy wrote:
> MySQL lets you use replace syntax if you have data and you don't know
> if it's new or not.  Is there anything in Cakephp that'll let you do
> that?   In other words, I don't know if the data I'm putting into my
> database is brand spanking new or just updated.  I'd rather not have
> to check and just let the database handle it, but not sure the
> framework supports that.
>
> Anyone know?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to