<?php
// Start output buffering and session early
ob_start();

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

$host = "localhost";
$dbname = "highhero_thrillsense";
$username = "highhero_thrillsense";
$password = "Pquxacfg29!";

try {
    $pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8mb4", $username, $password);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("Connection failed: " . $e->getMessage());
}

define('OPENAI_API_KEY', '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');