How does the information from form inputs store in the database?

When a form is submitted, how does the information from the various input fields of a form store in a database?

https://www.codecademy.com/paths/web-development/tracks/learn-html-web-dev-path/modules/learn-html-forms/lessons/html-forms/exercises/submit-form

Quick, simple example:

You have a form with some input fields

<input type="text" name="username">
<input type="email" name="email">

A back-end language (whichever it may be) would then receive the values from the submitted form

username = form["username"]
email = form["email"]

and communicate with a database to store the submitted data

INSERT INTO users (username, email) VALUES (username, email)

This is, in simple terms, how it works.
You first collect the values from the form, and then store them in the database.

3 Likes

Thanks a lot for this response. Very insightful.