When the form is submitted, all user input is available as a variable depending on your PHP configuration (e.g. $HTTP_POST_VARS["field1"] or maybe just $field1 ) and you can process this or do whatever you want to it.
After that it's no great leap to connect to a database and insert/update as needed.
Perhaps this tutorial will help?