<?php
try {
    $db = new PDO('sqlite:app_feed.db');
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

    // This ensures the users table exists with the required columns
    $db->exec("CREATE TABLE IF NOT EXISTS users (
        id TEXT PRIMARY KEY,
        name TEXT,
        phone TEXT UNIQUE,
        balance REAL DEFAULT 0.00,
        tier TEXT DEFAULT 'Bronze Tier'
    )");

    echo "Database table 'users' is verified and ready!";
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage();
}
?>