Here is the code and steps in video you can refer the solution for your problem on how to connect phpwith mysql using Xampp Server. We use phpMyAdmin as a database administrative tool to sync with mysql and php which bridge connection between web client and server.
Both these stacks offer similar performance due to similar software components yet the difference lies within the efficiency and outcomes. Here are some prominent differences that give XAMPP an edge over WAMP. WAMP works just in Windows working. XAMPP Alternatives 1. WampServer is one of the best Windows web application development environment, similar to XAMPP. EASYPHP is one of the best XAMPP alternatives. It is the best web server tool created by Rob McCool in 1995. AMPPS is an open-source. Here, we have successfully created a login form validation. Using PHP and WAMP/XAMPP, and we created and executed it. I will continue my next article to give you in-depth knowledge about XAMPP, FileZilla, and GitHub lessons.
What is Xampp?
Xampp is an abbreviation for cross-platform, Apache, MySQL, PHP and Perl, and it allows you to build WordPress site offline, on a local webserver on your computer. Xampp is an open source software developed by Apache friends. The use of Xampp is to test the clients or your website before uploading it to the remote web server.
To Know about how to download and install Xampp server in local pc computer you can read this article Read More
Easyphp Xampp Software
To Connect php with mysql database you need to install XAMPP which is an easy to install Apache distribution containing MariaDB, PHP, and Perl.
I had demonstrated this problem with a simple html registration form written in php having some 4 to 5 fields in it and connect with mySql phpMyAdmin database administrative tool using Xampp Server i.e localhost server.
Below is the Video & Code for step guide on how to connect html registration form and php mySql using xampp server and its setting to establish the phpMyAdmin database with localhost server.
HTML Registration Form(sample_register.html)
Details Entry Form
details entry form how to connect mysql with php using xampp
//These are the main settings to establish your connection with mysql database it could vary as per your system
Here are the steps of setting the connection and running the html registration form with phpMyAdmin mySql database using xampp server(localhost)
To Download latest Xampp Server click download xampp 7.4.6 / PHP 7.4.6/8.0.0
You can alsoread to this article for bsc computer science syllabus 2020 Read article
you can also read to this article for bsc IT syllabus 2020 Read article
Read this article for Important Programming Languages a B.Sc computer science/Bsc IT student must know Read article
XAMPP is an AMP stack which lets you install Apache, MySQL and PHP in your computer together with some other useful software. It has been designed to provide you an easy installation experience. It’s free and available for Windows, Mac OS and Linux.
Downloading and Installing XAMPP
Go to XAMPP web site and download the installer based on your operating system. Installation should be similar to a normal software installation you do in your operating system.
When installing, there would be an option to select whether you want to run Apache and MySQL as services. If you chose it, Apache and MySQL will start at system boot-up which may not need if your computer is tight with memory resources or if you are not doing PHP development frequently. You can change these settings after installation.
Starting Apache and MySQL
Go to the location where you installed XAMPP (usually C:Program Filesxampp) and double click on XAMPP Control Panel (xampp-control.exe). This will bring you following screen. Click on Start buttons next to Apache and MySQL for starting them.
Easyphp O Xampp
Once opened, you would see XAMPP icon on the right of your task bar. Clicking on that icon will show/hide XAMPP control panel. To exit from XAMPP, click on Exit button in XAMPP Control Panel.
Apache Is Not Starting Error
Sometimes you would experience that even after clicking Start button several times, Apache is not starting. This is usually because some other service is running at the port required by Apache which is 80 by default. An easy reproducible way for this error is starting Skype before starting Apache.
In such a case, you would need to stop other service temporary and restart it after starting Apache. For an example, if you do so for Skype, it will find another port for working after restarting.
In the installation directory, you would see a program called Port Check (xampp-portcheck.exe). Double click on it and it will show you status of required port for Apache, MySQL and other software that comes with XAMPP. If required ports are already occupied, it will show the names of services that run on those ports.
Making Requests to the Server
Once you started Apache in control panel, type http://localhost in your web browser. This would bring you a web page that lists XAMPP related details.
Putting Stuff in Web Folder
Under XAMPP root directory there is a folder called htdocs. That’s where you should put your web site related stuff. For each web site you create, it’s better to create a folder inside htdocs folder and then put content inside that to avoid conflicts.
For an example, you can create a folder called learnphp inside htdocs folder and put welcome.php inside that. Then you can access it via the URL http://localhost/learnphp/welcome.php.
Root URL and Home Page Content
In above example, root URL of your web site is http://localhost/learnphp/ and it’s generally expected to see home page of the web site once root URL is typed in the web browser.
Usually web servers have been configured to look for an index file (can be index.htm, index.html, index.php etc) in the root of the web site folder and show its content for the home page of the site. So, if you had a file called index.php inside learnphp, you would see its output once you typed http://localhost/learnphp/.
Make sure you have only one index file in your web site to avoid conflicts. If you have more than one (say index.html, index.php), required file will be chosen based on the order defined in your web server’s configuration settings.
Locations of Configuration Files
Based on your requirements, sometimes you would need to change default settings of your web and database servers. Usually this is done by altering their configuration files. In XAMPP, Apache, PHP and MySQL configurations files are located in following locations (This assumes XAMPP installation directory as C:Program Filesxampp).
Easyphp Xampp Tutorial
Apache Conf File (httpd.conf): C:Program Filesxamppapacheconfhttpd.conf
PHP Conf File (php.ini): C:Program Filesxamppapachebinphp.ini
MySQL Conf File (my.cnf): C:Program Filesxamppmysqlbinmy.cnf
In XAMPP, some Apache configuration settings have been moved to sub configuration files under xamppapacheconfextra.
Easyphp Xampp Download
To open my.cnf, double clicking on it may not work sometimes. In that case, open Notepad and then locate my.cnf file by setting Files of Type to All Files as below.
Restarting Apache and MySQL
Easyphp Xampp Wamp
To take effect any configuration change, it’s required to restart Apache and/or MySQL. In XAMPP, if these two are already running, stop them and start again in the Control Panel.