PHP Database connection
Last Updated :
02 Nov, 2020
The collection of related data is called a database. XAMPP stands for cross-platform, Apache, MySQL, PHP, and Perl. It is among the simple light-weight local servers for website development.
Requirements: XAMPP web server procedure:
- Start XAMPP server by starting Apache and MySQL.
- Write PHP script for connecting to XAMPP.
- Run it in the local browser.
- Database is successfully created which is based on the PHP code.
In PHP, we can connect to the database using XAMPP web server by using the following path.
"localhost/phpmyadmin"
Steps in Detail:
- Open XAMPP and start running Apache, MySQL and FileZilla
- Save the file as “data.php” in htdocs folder under XAMPP folder.
- Then open your web browser and type localhost/data.php
Finally the database is created and connected to PHP.
If you want to see your database, just type localhost/phpmyadmin in the web browser and the database can be found.
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...