<?php
include 'includes/config.php';
header('Content-Type: text/plain');

echo "--- DEBUG KONEKSI DATABASE ---\n";
echo "Host: $host\n";
echo "User: $user\n";
echo "DB: $db\n\n";

$query = mysqli_query($conn, "SELECT * FROM dokter");
if (!$query) {
    die("Gagal Query: " . mysqli_error($conn));
}

echo "Jumlah Dokter Ditemukan: " . mysqli_num_rows($query) . "\n\n";

while ($row = mysqli_fetch_assoc($query)) {
    echo "ID: " . $row['id'] . " | Nama: " . $row['nama'] . " | Spesialis: " . $row['spesialis'] . "\n";
}
?>
