+ 1
How can I add a database to my website so that forms filled can be stored and queried?
3 Answers
+ 3
First of all, you need a database, like mysql, postgres, whatever on your machine. Then you need to have access to that database through your website, Google it for example connecting scripts.
To do that I recommend using PHP if you are just starting.
Also if you want to do it easy, try out cloud9. (www.c9.io)
It will create temporary server on cloud and set it to your needs.
+ 3
The most common solution to begin is to use a back-end to communicate with your database.
It can be written in any language as long as there is a connector for your database.
JS -> back-end -> DB
One of the most documented setup is:
- back-end : php
- database : mysql
From the html:
<form action="mypage.php" method="post">
<input...
You can get the form's content with php's $_POST array.
You can then use php's mysql connector (documented on php.net) to query your database.
This is only one example, to help you start googling.
0
Thank you