prepare($sql); $stmt->execute(); if ($stmt->rowCount() > 0) { $result = $stmt->fetchAll(PDO::FETCH_ASSOC); // ✅ Always log what we’re sending back error_log('📊 Dashboard Result: ' . json_encode($result, JSON_PRETTY_PRINT)); printSuccess($result); } else { error_log('⚠️ Dashboard: No records found'); printFailure("No records found"); } ?>