<?php
$host = "localhost";
$dbname = "";
$username = "";
$password = "";

try {
    $pdo = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("Veritabanı bağlantısı başarısız: " . $e->getMessage());
}

$dosyaAdi = "veriler.txt";

try {
    $dosya = fopen($dosyaAdi, "r");

    while (!feof($dosya)) {
        $satir = fgets($dosya);

        if (!empty($satir)) {
            $stmt = $pdo->prepare("INSERT INTO tablo_adi (sutun_adi) VALUES (:deger)");
            $stmt->bindParam(':deger', $satir);
            $stmt->execute();
        }
    }

    fclose($dosya);
    echo "Veriler başarıyla veritabanına eklendi.";
} catch (Exception $e) {
    echo "Hata oluştu: " . $e->getMessage();
}

?>
Veritabanı bilgilerini girin, "INSERT INTO tablo_adi (sutun_adi) VALUES (:deger) " sorgusundaki tablo_adi ve sutun_adi bölümünü düzenleyin. Bunu bi deneyin hocam