<?php
require_once __DIR__ . '/config.php';
try {
    $sql = file_get_contents(__DIR__ . '/install.sql');
    if (!$sql) throw new Exception('install.sql not found');
    db()->multi_query($sql);
    do { if ($res = db()->store_result()) $res->free(); } while (db()->more_results() && db()->next_result());
    echo '<h2>Install OK</h2><p>hotspot_payment_transactions table ready.</p><p>Security: now delete/rename install.php.</p>';
} catch (Throwable $e) {
    echo '<h2>Install failed</h2><pre>'.htmlspecialchars($e->getMessage(), ENT_QUOTES, 'UTF-8').'</pre>';
}
