-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_debug.php
More file actions
17 lines (17 loc) · 795 Bytes
/
_debug.php
File metadata and controls
17 lines (17 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
session_start();
require_once __DIR__ . '/app/models/mysqli_db.php';
echo "<pre style='background:#1a1a2e;color:#fff;padding:20px;font-family:monospace'>";
echo "=== SESSION ===\n";
print_r($_SESSION);
echo "\n=== USERS ===\n";
if (isset($conn) && !$conn->connect_error) {
$r = $conn->query("SELECT id, first_name, last_name, email, LEFT(password,30) as pass_hash FROM users");
if ($r && $r->num_rows > 0) while ($row = $r->fetch_assoc()) print_r($row);
else echo "NO USERS\n";
echo "\n=== INCIDENTS ===\n";
$r = $conn->query("SELECT * FROM incidents ORDER BY id DESC LIMIT 5");
if ($r && $r->num_rows > 0) while ($row = $r->fetch_assoc()) print_r($row);
else echo "NO INCIDENTS\n";
} else echo "DB FAIL: " . ($conn->connect_error ?? 'unknown');
echo "</pre>";