<?php
// config.php
$db_host = 'localhost';
$db_user = 'yaetfswo_digital';
$db_pass = 'et.8PJ9ikUnuVG2';
$db_name = 'yaetfswo_digital';



$conn = new mysqli($db_host, $db_user, $db_pass, $db_name);

if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}

// Create tables if they don't exist
$sql = "
CREATE TABLE IF NOT EXISTS categories (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(255) NOT NULL UNIQUE
);

CREATE TABLE IF NOT EXISTS channels (
    id INT AUTO_INCREMENT PRIMARY KEY,
    category_id INT,
    name VARCHAR(255) NOT NULL,
    uri TEXT NOT NULL,
    drm_scheme VARCHAR(255),
    drm_license_uri TEXT,
    logo TEXT,
    FOREIGN KEY (category_id) REFERENCES categories(id)
);
";

$conn->multi_query($sql);
while ($conn->next_result()) {;} // Clear multi_query
?>
