data submition, editable

Questionsdata submition, editable
Chris asked 1 month ago

Is it possible to select the grid data from joined relational database tables,
then any updates in the grid get inserted into a totally new a relational database table?

Example

// join tables for grid display
$g->select_command = “SELECT i.id, invdate , c.name, i.note, i.total, i.closed FROM invheader i INNER JOIN clients c ON c.client_id = i.client_id”;

// then save any updates to a new table.
$g->table=”another_table”;

2 Answers
Abu answered 1 month ago

Hi,

Yes, that’s doable. You can have your custom insert query code as well and skip the default working of datagrid library.

You can check on_insert / on_update / on_delete events from this link: https://www.gridphp.com/docs/grid-events/

clinicalluge punishdoll answered 2 weeks ago

Yes, it’s possible. Since select_command uses a JOIN, updates won’t work automatically. You need to handle inserts manually using a custom event or custom_sql to save updates into another_table.

Read more: https://www.gridphp.com/docs/grid-events

Your Answer

19 + 1 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?