<?php
require_once __DIR__ . '/../includes/db.php';

try {
    $roles = fetchAll("SELECT * FROM roles");
    echo "Roles in 'roles' table:\n";
    foreach ($roles as $role) {
        echo "  - ID: {$role['id']}, Name: {$role['name']}\n";
    }
    
    $users = fetchAll("SELECT id, name, username, email, role, company_id FROM users LIMIT 5");
    echo "\nSample Users:\n";
    foreach ($users as $u) {
        echo "  - ID: {$u['id']}, Name: {$u['name']}, Username: {$u['username']}, Role: {$u['role']}, Company ID: {$u['company_id']}\n";
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
