$server = "localhost";
$username = "root";
$password = "";
$dbname = "db_name";
$connection = new mysqli($server, $username, $password, $dbname);
if ($connection->connect_errno) {
echo "Veri tabanına bağlanırken bir hata oluştu : " . $connection-> connect_error;
exit();
}
$connection->close();