How do I conect html code with a database?

I have written a calculator with html and i want to save the results in a database.

You need to pass the values to the code in the HtmlComponent using messages. See the article Working with the HTML Component in Wix Code for details.

https://www.wix.com/code/home/forum/community-discussion/solution-html-iframes-connected-to-a-dataset-on-a-dynamic-page