Editor Insert Multiple Data From Existing Table to Other Table

Editor Insert Multiple Data From Existing Table to Other Table

vincmeistervincmeister Posts: 136Questions: 36Answers: 4

Hello Allan,

I have a datatable from a mysql view A that can be edited on client side.
After editing, i want to submit all the data to new mysql table B

Is it possible to use editor? How to? I read about Editor.multiSet, but i have no luck, please help, or maybe any example reference.

My other scenario is using table.rows().data() to get all data and pass to serverside (custom php)

Please advise the better and faster way,
Thank you

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin

    Do you want to submit the data to both A and B? If so, that isn't something that the Editor PHP libraries support, but you could readily write your own PHP to do. Alternatively, if you just want to write to table B, then simply have a different PHP file that is used for the Editor ajax option to it submits it requests there. It might get complicated when dealing with the response though, since that would then read the updated data from table B.

    Allan

  • vincmeistervincmeister Posts: 136Questions: 36Answers: 4

    Hi Allan,

    Only write to B.
    So how to get the all data from A and write to B
    Looping? Or is there any editor function that can be used?

    Please advise, thank you

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin
    Answer ✓

    As I say, you would have two scripts - one for getting the data from table A and a second one, which the Editor ajax option points to, which writes the data.

    As I also say though you will run into problems when the read is done for the updated data since it would be reading from table B (i.e. where the updated data is). However, you presumably wouldn't want to read from table A at that point since that data wouldn't have been updated and the table would appear to revert to the end user!

    Allan

This discussion has been closed.