<?php
// config.php

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

define('SPOTIFY_CLIENT_ID', 'cfb048c2136f4018b66471d4dc0cb16d');
define('SPOTIFY_CLIENT_SECRET', '104858f2658a4025a2a6a846eddc806f');
define('SPOTIFY_REDIRECT_URI', 'https://dj.megaload.co.za/callback.php');
define('SPOTIFY_SCOPES', 'user-library-read playlist-read-private');
define('LASTFM_API_KEY', '72c2e227aa628e581a68c1a83720884e');


$host = 'localhost';
$hostremote = 'megaload.co.za';
$db = 'megaloa1_spottydata';
$user = 'megaloa1_spotty';
$pass = 'xF}{Ve&dsk?6';

try {
    $pdo = new PDO("mysql:host=$host;dbname=$db;charset=utf8mb4", $user, $pass);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("❌ Database connection failed: " . $e->getMessage());
}

try {
    $pdoexternal = new PDO("mysql:host=$hostremote;dbname=$db;charset=utf8mb4", $user, $pass);
    $pdoexternal->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("❌ Database connection failed: " . $e->getMessage());
}

?>