Program:
<?php
$host = "localhost";
$user = "root";
$pass = "1234";
$conn = mysqli_connect($host,$user,$pass);
if(!$conn)
{
die('Could Not Connect:'.mysqli_errort());
}
else
{
echo "Connected Successfully: <br>";
print_r($conn);
mysqli_close($conn);
}
?>
Output: