Insert Data into MySQL Database using PHP
HTML structure: First we make a HTML structure that needs to take User input from . HTML structure is a record which stores data of a user on a web server utilizing intelligent controls. A HTML structure contains distinctive sort of data, for example, username, password, contact number, email id and so forth.
The components that are utilized in a HTML structure are check box, input box, radio catches, submit catches and so forth With the assistance of these components, the data of a user is submitted on the web server.
Index.php Code:
Now Create a database and a table inside it.
Complete Steps to Create Database and a Table:
- Start Wamp Server.
- Open localhost/phpmyadmin in your web browser.
- Create database of name data and table of name student.
dbconnect.php
How to get form data:
We are going to collect the form data submitted through HTML form. PHP $_POST method is a PHP super global variable which is used to collect data after submitting the HTML form.
forminsert.php
Note : If you want your password to be encrypted, then Instead of $password=$_POST['psw'] you have to use $password=md5($_POST['psw']).
For Details Visit YouTube Channel : Techno Junkie
0 Comments
if you have any doubt contact me.