Hi Stackoverflow,
I am writing a component and I have a scenerio of storing data into multiple tables with One-To-Many relationship.
Master table is Student and Child table is Student_Subjects.
One student can select multiple subjects.
I want to store the data in Student_subject table with student. Data is submitted from one form where user will be created and subjects will be selected.
Currently I am using JTable Class.
Is there any way to run a transaction query to store the data in both tables? If Yes, then how can i get the student id (auto generated) store it into Student_Subject using the same transaction query batch?
Please guide. Example with code is highly appreciated and needed.