You can learn how to connect a PHP MY ADMIN database and Insert a data using PHP
Prerequisites :
- Download and Install a Xampp Server from here (https://www.apachefriends.org/index.html)
Steps to start server :
- Open a Xampp Control Panel Then Start Apache and MySql
Steps for run the project:
- Copy the project files and paste into C://Xampp/htdocs/
- Create a folder then paste the project files
- Open your browser navigate to localhost/phpmyadmin/
- Create a database and table with with sno, username and password columns
- Update the username, password and database name in insert.php file
- Then open a browser Type localhost/foldername that you have created
Then you can see this project running in your browser
About the project
In index.html A form with 2 input boxes and 1 button to accept Username and Password with Register button After you click the register button the form submit the post request to Insert.php
In Insert.php
- If condition checks the form is submitted
- Replace the username, password and database name that you have created
- Then we make the connection to The database
- We have check if the error in connection
- Then we get username and password from the request that you have made from the form
- Write the SQL Insert query with your desire table name
- And execute the query and Check if error
- Finally close the connection
Thank you Sarbudeen S