I have two html forms to register products in an RMA. The first form is really basic and I can easily store the data to the db. The problem comes when I use $newrmaid = $conn->insert_id;
(where $conn
is a mysqli-object) to get the auto-incremented ID from the db when i insert the data from the first form.
In the second form I need information from the db related to the key in $newrmaid
.
I got it to work with a set number of products (combine the two forms), but the RMA can have a dynamic number of products attatched to it.
The idea is that when you register a new RMA you get presented a new page with all products that are attatched to this RMA plus a form for attatching new products. When you insert a new product the page refreshes and you can choose to insert more products.
Any good advice?