Hi,
if I want to change data in the second table, then it is stored in the table as a new Daternsatz in the database. Normally, the changed value will be saved.
What is the problem?
Thank you very much.
F.
if I want to change data in the second table, then it is stored in the table as a new Daternsatz in the database. Normally, the changed value will be saved.
What is the problem?
Thank you very much.
F.
Hello Fredolino,
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How do I save form data to a database table?
How to load record data from a database table into your form
My form data isn't saving to the database correctly
My CFv5 form data isn't saving to the database correctly
How can I edit my database table and debug queries?
How can I select 'types' in a database table?
How can I edit a record from a database table?
How can I add a new column to a database table or change a column type?
P.S: I'm just an automated service😉
I'm not a Chrono professional, but after checking your new post, I think that the following links may help:
How do I save form data to a database table?
How to load record data from a database table into your form
My form data isn't saving to the database correctly
My CFv5 form data isn't saving to the database correctly
How can I edit my database table and debug queries?
How can I select 'types' in a database table?
How can I edit a record from a database table?
How can I add a new column to a database table or change a column type?
P.S: I'm just an automated service😉
Hi,
if I want to change data in the second table, then it is stored in the table as a new Daternsatz in the database. Normally, the changed value will be saved.
What is the problem?
Thank you very much.
F.
HI Fredolino,
For a record to be updated there has to be a primary key value - id_auftrag in this case - which matches the existing record.
Bob
For a record to be updated there has to be a primary key value - id_auftrag in this case - which matches the existing record.
Bob
Hi Bob,
thanx for the tipp.
I must have a Costum Code in Setup bevor DB Save-Aktion (for 2n Table)?
F.
thanx for the tipp.
I must have a Costum Code in Setup bevor DB Save-Aktion (for 2n Table)?
F.
Hi Fredolino,
You have to include the record id in the data - you haven't said how this form works so hard to say more.
Bob
You have to include the record id in the data - you haven't said how this form works so hard to say more.
Bob
Hello,
in DB Save Action for the 2nd table I have this updated code:
In the DebugInfo the changed value is included. But if I see in the database, then the value is not stored but.
Where now is still the problem?
F.
in DB Save Action for the 2nd table I have this updated code:
<?php
return array('Firma_1.id_firma' => $form->data['Firma.id']);
?>
In the DebugInfo the changed value is included. But if I see in the database, then the value is not stored but.
Where now is still the problem?
F.
Hi,
i have now in the DB Save Action this code:
it seems to me all right in Debug Info (Screen), but the changed data is not saved. What is now the problem?
F.
i have now in the DB Save Action this code:
<?php
return array('Firma_1.id_firma' => $form->data['Firma']['id']);
?>
it seems to me all right in Debug Info (Screen), but the changed data is not saved. What is now the problem?
F.
Hi Fredolino,
Both queries are updating the record with the ID 423. Is that what you intend?
Bob
Both queries are updating the record with the ID 423. Is that what you intend?
Bob
Hi Bob,
you're right, the Statement for the 2nd table (Model Firma_1) is incorrect.
Now there are 2 updates. However, it is only correct if only the record is updated, which is to save on the form the modified value in the database.
F.
you're right, the Statement for the 2nd table (Model Firma_1) is incorrect.
Now there are 2 updates. However, it is only correct if only the record is updated, which is to save on the form the modified value in the database.
F.
Hi Fredolino,
You have to make sure that the ID matches the record that you want to update.
Bob
You have to make sure that the ID matches the record that you want to update.
Bob
OK,
I give now only for the container with the change data a hidden field with the ID:
Firma_1[__N__][id_auftrag]
In Setup then then for the 2nd table in DB save:
But that does not work because I have to have the index of the array:
[0] or [1]
How do I get it?
I give now only for the container with the change data a hidden field with the ID:
Firma_1[__N__][id_auftrag]
In Setup then then for the 2nd table in DB save:
<?php
return array('Firma_1.id_auftrag' => $form->data['Firma']['id']);
?>
But that does not work because I have to have the index of the array:
[0] or [1]
How do I get it?
Hi Fredolino,
Presumably the first one will be $form->data['Firma'][0]['id'] and the second one $form->data['Firma'][1]['id']
You could also use the Multi Save option in a single DB Save action.
Bob
Presumably the first one will be $form->data['Firma'][0]['id'] and the second one $form->data['Firma'][1]['id']
You could also use the Multi Save option in a single DB Save action.
Bob
Hi Bob,
following custome code before storing the second table in the setup seems to work:
:-)
Thanks a lot!
F.
following custome code before storing the second table in the setup seems to work:
<?php
if (is_array($form->data['Firma_1']) &&
is_array($form->data['Firma']) &&
$form->data['Firma']['id'] <> 0)
{
foreach($form->data['Firma_1'] as $k => $v)
{
$v['id_firma'] = $form->data['Firma']['id'];
$form->data['Firma_1'][$k] = $v;
}
}
?>
:-)
Thanks a lot!
F.
This topic is locked and no more replies can be posted.