Kod:
<?php
$sunucu = "localhost";
$kullanici = "kullanıcıadı";
$parola = "parola";
// Bağlantı oluşturma
$bag = new mysqli($sunucu, $kullanici, $parola);
// Bağlantı kontrolü
if ($bag->connect_error) {
die("Bağlantı hatası: " . $bag->connect_error);
}
echo "Bağlantı sağlandı!";
$bag->close();
?>