<?php
$servername = "localhost";
$username = "username";
$password = "password";
$database = "database";
// Create connection
$conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?>
<?php
$host="localhost";
$user="root";
$password="";
$db="attendance";
$conn=mysqli_connect($host,$user, $password, $db);
if(mysqli_connect_errno()){
echo "Connection Fail".mysqli_connect_error();
}
?>