I have created a form in admin panel with various fields. Now the fields here doesn't belong to one single table. On the save, I want some values go into one particular table while others to go into some other table. I am able to show up the data using joins but don't know how to save them back.
Lets say, I have a tblUser with fields:
tblUser
- user_id INT(11) Auto Increment
- username VARCHAR(15)
- store_id SMALLINT(5)
- bank_id INT(11)
Here, store_id and bank_id have foreign key constraints to auto-increment id's of tblcore_store (id, store_name) and tblBanks (id, bank_name, bank_acc) respectively. Now the fields in the form are:
- Username
- Store Id
- Store Name
- Bank Name
- Bank Account
When, admin click save I want the data of form to go into their respective tables and also having their references in store_id and bank_id.