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

    $query = "CREATE TABLE IF NOT EXISTS apks (
        id INTEGER PRIMARY KEY AUTOINCREMENT,
        owner_id TEXT NOT NULL,
        nameapp TEXT NOT NULL,
        extimage INTEGER NOT NULL,
        fileimage TEXT NOT NULL,
        iconeapp TEXT NOT NULL,
        package TEXT NOT NULL,
        ext_provider INTEGER NOT NULL,
        buylink TEXT NOT NULL
    )";

    $db->exec($query);
    echo "Database and table created successfully.";
} catch (PDOException $e) {
    echo "An error occurred: " . $e->getMessage();
}
?>