<?php
// Temporary verification script
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$out = '';

try {
    $db = new mysqli('localhost', 'root', '', 'db_perpustakaan');
    $r = $db->query('SHOW TABLES LIKE "ruang_baca"');
    $out .= 'ruang_baca table count: ' . $r->num_rows . "\n";

    // Check migration row
    $r2 = $db->query('SELECT * FROM migrations WHERE version LIKE "%CreateRuangBaca%"');
    $out .= 'migration row count: ' . $r2->num_rows . "\n";

    // Check columns
    $r3 = $db->query('DESCRIBE ruang_baca');
    $out .= 'columns: ';
    while ($row = $r3->fetch_assoc()) {
        $out .= $row['Field'] . ' ';
    }
} catch (Exception $e) {
    $out .= 'ERROR: ' . $e->getMessage() . "\n";
}

echo nl2br($out);
