Good afternoon guys.
I have the following situation:
In a vehicle registration module, it is necessary to dynamically register a vehicle in a single vehicle followed by all its models and group, being that a vehicle can have N models and be registered in N groups, what is the best way for me to do it such registration
In other words, the user enters the vehicle registration module and clicks ENTER VEHICLE then opens a registration screen and within this register he informs the name of the vehicle and then on the same screen click on add model, and register the model, photo of this model and insert this model inside a certain group, then he clicks ok next to it and this data is there in stand by (not yet registered in the bd) then after this the user has the option to click again to register model and register another model with other photos and in another group and then click on ok and this data is also in stand by.
Now comes the difficult part, below this form has a register button, when I click there will register the vehicle_id, vehicle_title and vehicle_name in the VEHICLE table and the model_model, vehicle_cover, vehicle_module in the VEHICLE_MODEL table.
The question is, what is the best way for me to accomplish this? Can I simultaneously record the data of 1 SINGLE FORM in 2 TABLES IN BD? Remembering that within this FORM there may be 1 or more model array, that is, if I register a vehicle and within the register 2 more models will be recorded the vehicle data in the vehicle table and 2 model records with different ids in the modelmodel table