<?php
$conn = new mysqli("localhost", "root", "", "goganiakrytite50000pts", 3306);
if ($conn->connect_error) {
die("Ошибка подключения: " . $conn->connect_error);
}
$sql = "SELECT status, COUNT(*) AS total
FROM request
GROUP BY status";
$result = $conn->query($sql);
$stats = [];
while ($row = $result->fetch_assoc()) {
$stats[$row['status']] = $row['total'];
}
$total = array_sum($stats);
?>