Basic Principle: the <iframe> behaves like just another tab in your browser for most purposes (not quite all). If you treat it as such then all you need to do is send the data to the server (<form> or AJAX). You apparently have chosen to use a <form>
Now this requires that you know how to send data to a database (which is on the server) from your page (on the client).
In either case you will need server side code do actually access the database. I use PHP. Your form will target this page as its
action attribute. That means that the submit button needs to be on the form (easiest way) and INSIDE your <iframe> = again, it's easiest to treat it as a separate tab.
You possibly have a lot to learn and here's the place I learned it:
W3Schools Online Web Tutorials[
^]
Since I don't know what you actually know I didn't pre-set the link to the appropriate sections. You shouldn't have much trouble filling in the gaps.