<?php
header('Content-Type: text/plain');
error_reporting(E_ALL);
ini_set('display_errors', 1);

require_once __DIR__ . '/config.php';
require_once __DIR__ . '/includes/db.php';

try {
    $db = DB();
    $row = $db->fetchOne("SELECT * FROM `affiliation_applications` WHERE `application_number` = 'AFF1779143034'");
    if ($row) {
        echo "=== APPLICATION RECORD FOUND ===\n";
        print_r($row);
    } else {
        echo "APPLICATION AFF1779143034 NOT FOUND in database.\n";
    }
} catch (Exception $e) {
    echo "ERROR: " . $e->getMessage() . "\n";
}
