23
CREATE MYSQL CONNECTION IN PHP
XAMPP is the most popular software package which is used to set up a PHP development environment for web services by providing all the required software components.XAMPP provides easy transition from local server to live server. XAMPP is a AMP stack which stands for Cross platform, Apache, MySQL, PHP, perl with some additional administrative software tools such as PHPMyAdmin (for database access).
XAMPP is a completely free, easy to install Apache distribution.
<?php $conn = mysqli_connect("localhost","root","");
?>
OR
<?php
$localhost='localhost';
$root='root';
$pass='';
mysqli_connect($localhost,$root,$pass);
?>
If you are using database here are the connections.
<?php $conn = mysqli_connect("localhost","root","","db_name");
?>
OR
<?php
$localhost='localhost';
$root='root';
$pass='';
$db_name='db_name';
mysqli_connect($localhost,$root,$pass,$db_name);
?>