Inserting data into the database
To insert the form data into a database table, let's create a new table in our Civic_Center
database. Let's call it User_Queries
. This table will have the following five fields:
An auto-increment ID field
A field of type
varchar
to save the name of the userA field of type
varchar
to save the e-mail ID of the userA field of type
int
to save the contact number of the userA field of type
varchar
to save the value of the facility the user wishes to avail
Let's go over to localhost/phpmyadmin
in your browser. Click on the Civic_Center database link in the left navigation. Click on the following New link it to add a new table. You will be presented with the following screen. Fill in the details as discussed earlier:
Click on the Save button at the bottom of the screen, and this will create your new table—User_Queries
. We have now created a blank table that is ready to accept data values.
Create a new PHP page form.php
, which will hold the PHP code to post the form values...