Update field in linked table

Update field in linked table

maidenmaiden Posts: 16Questions: 6Answers: 0

Hi there,
I've got a problem with updating a field in a linked table. I followed this example > https://editor.datatables.net/examples/advanced/joinArray.html and this works well so far, but I have an additional field in the linked table 'permission' that has to be updated too and I can't get it to work. The additional field should be updated with a value (date) from a field in the main table that's being edited. I tried to call a custom function on(postEdit)
$db->update( 'tische', array( 'datum' => $values["datum"] ) or on(submitComplete)
but that updates the additional field in ALL rows in the linked table, obviously because there's no reference to the row that's being edited.
How can I add a "where"-clause to the $db->update ?
regards, martin

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    and I can't get it to work.

    I'm afraid you won't be able to with our PHP libraries at the moment either. Sorry. The link tables should only contain the keys to join the two tables - all other information can be deleted on edit when the rows are reinserted.

    Addressing that in some way is definitely something I want to add to Editor in future.

    Allan

  • maidenmaiden Posts: 16Questions: 6Answers: 0

    Thank you, Allen, that info saved me a lot of time of useless trying.
    regards, martin

Sign In or Register to comment.