<?php
require_once 'config/database.php';
require_once 'includes/functions.php';

$db = getDB();
$courseId = 14;

echo "=== Course Modules for ID 14 ===\n";
$stmt = $db->prepare('SELECT id, title, sort_order FROM course_modules WHERE course_id = ? ORDER BY id');
$stmt->execute([$courseId]);
$modules = $stmt->fetchAll(PDO::FETCH_ASSOC);
print_r($modules);

echo "\n=== course_lessons Schema ===\n";
$stmt = $db->query('DESCRIBE course_lessons');
$schema = $stmt->fetchAll();
print_r($schema);

echo "\n=== Sample course_lessons for 14 ===\n";
$stmt = $db->prepare('SELECT * FROM course_lessons WHERE course_id = 14 LIMIT 5');
$stmt->execute();
$samples = $stmt->fetchAll();
print_r($samples);

echo "\n=== END ===\n";
?>

