It is very easy to connect to server using PHP and MYSQL.
PHP is a very friendly Programming Language that any one can learn who know the basics of the Front End Development. PHP is a programming Language which execute the piece of code only in a server.
To run the PHP code, there are some Local Server control Panel are there like XAMPP, WAMP, YAMP, etc.
Here we are going to use XAMPP. XAMPP is one of the best control panel among the others like wise the PHP among the Others.
Connecting to Server :
In Php, there is a predefined function which helps the user to get connect to the server. mysqli_connect();
The parameters of this Predefined Function are:
- Local host or 127.0.0.1 This is a IP Address of the Server. It is unique for different users. We have to keep it secure.
- Root -> "root" is the default username in XAMPP, while you are executing in the server you have to create the username and Password.
- ' ' -> The password for the XAMPP to connect to server is NULL
So lets begin the Code.