Well... those are two different things but certainly doable. First of all you will need to create the form and be able to get the variables and values out of it. So, post the form to a DTML Method and call those variables.

<dtml-var name_of_variable>

Now, you will need to get a database and database adapter set up. After that you create a ZSQL Method that has the insert SQL statement in it. From there you just have to call the ZSQL Method from within your method that handles the form request.