Why not use an auto incremented primary key in the invoice table?
On Apr 13, 12:38 pm, Matt <[email protected]> wrote:
> So I have an invoice model and a setting model. When the user creates
> a new invoice, I need to automatically change the invoice_number to
> one more than the current in the Settings model.
>
> I figured out that the code below will create a new row in my
> database, but I need to figure out how to simply modify the existing
> row. Please help!
>
> $this->Company->Setting->save(array('invoice_number'=>'999'));
> $this->Company->Setting->save();
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---