PHP CONNECTION
Step 1:- Make a database in PHPMyAdmin with name phpconnection.
Step 2:- Now create a page with name checkConnection.php as follow..
# checkConnection.php
<?php
$hostname = ‘localhost’;
$database = ‘phpconction’;
$username = ‘root’;
$password = ”;
$conn = mysqli_connect($hostname, $username, $password, $database);
if($conn){
echo ‘connection is created’;
}
else{
if(mysqli_connect_errno()){
echo ‘connection is not created:’. mysqli_connect_error();
}
}
?>
Step 3:- Now go to your browser and run it.. localhost/connection/checkConnection.php
here folder name is connection in that has checkConnection.php page.
Step 4:- After Run it will show “connection is created”.
Step 5:- If there is any mismatch in database name, username and password, It will show connection error.