I have PHP form, which is read from multiple tables. After editing it (adding new rows or just update) I want to INSERT INTO ... UPDATE both of them.
For now I found solution HERE based on temporary tables, but is that a good approach and practice in 2020? I want to avoid stored procedures, because it's easier to maintain one application instead of two of them (just php, not php & mysql).
I use mysqli in my project and created custom DB class.
My two tables are:
table_tasks (`task_id`, `task_name`)
table_tasks_assigned_users (`task_id`, `user_id`)
When I add new task the process logic is:
Step 1. Insert into update in table_tasks
and get task_id
Step 2. Insert into update in table_tasks_assigned_users
with given task_id