<?php
error_reporting(E_ALL);
$host="localhost";  
$user="root"; 
$password=""; 
$database="test"; 
$conn=mysqli_connect($host,$user,$password,$database) or die(mysqli_error());
//cek koneksi 
if($conn){ 
//echo "berhasil koneksi"; 
}else{ 
echo "gagal koneksi"; 
} 
?>