Sorry for that,
I have a model Records and Timespans. DEBET and CREDIT have to be
inserted in the records table but also in the Timespans table in DEBET
and CREDIT
The first is not a problem but the second is. IT has to be additioned
not just replaced by the latest.
function add() {
if (!empty($this->data)) {
$this->Record->create();
if ($this->Record->save($this->data)) {
$this->Session->setFlash(__('The Record has
been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Record could
not be saved.
Please, try again.', true));
}
}
$timespans = $this->Record->Timespan->find('list');
$this->set(compact('timespans'));
what do I have to reference to where in fact I didn't quit get that
and do I have to change something in the view also?
Thanks,
- Tim
On Dec 1, 9:40 pm, Rob <[EMAIL PROTECTED]> wrote:
> So just a suggestion for future questions, describe the tables and
> their relationship in your question a little next time.
>
> Assuming you have a Records model and a Timespans model that are
> related to each other, and the relationships are described in the
> models for those two entities ...
>
> So, for example if you want to add the values from a Record to the
> values in the related Timespan, you would reference the $this->Record
> and $this->Record->Timespan
>
> On Dec 1, 1:45 am, webscriptz <[EMAIL PROTECTED]> wrote:
>
> > I'm making a register and I have a small problem,
>
> > I want two numbers to be additioned (+) with the numbers already in an
> > other table, unfortunantly I don't know how to do this.
>
> > i have a Record with "debet" and "credit" and i want to addition them
> > to "debet" and "credit" in timespans.
>
> > but they got controller & model records
>
> > please help,
>
> > Tim De Smedt
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---