get added record id as var and run 2 more queries

Questionsget added record id as var and run 2 more queries
BiLe asked 2 years ago

Hello,

when I have a grid and added a record, how can I fetch the inserted rows id and run 2 more queries (insert into another table). How can I do the same with an update?

Thank you

2 Answers
Mike answered 2 years ago

Your best bet is to use a custom update function which you define in the Grid Set-up, this is how I handle that scenario.

$e[“on_update”] = array(“update_data”,””,false);

Your update function would need to update the record and then add your additional SQL code at the end.

You can reference the Demo pages, “custom-events.php” for some ideas on how do handle this.

Thanks

Mike

Abu Ghufran Staff answered 2 years ago

Hi,

You can refer this section of the documentation:

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

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

14 + 14 =

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?