refactor(stats): improve database row fetching in tr_stats.php (#1985)

- Updated the method of fetching rows from the database to use a more streamlined approach with `DB()->fetch_row()`.
- Extracted the first column value directly from the result array for clarity and maintainability.
This commit is contained in:
Yury Pikhtarev 2025-06-21 03:34:11 +04:00 committed by GitHub
parent a33574c28f
commit 728116d6dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,8 @@ echo '<html><body><head></head>';
echo '<br /><br /><table border="1" cellspacing="0" cellpadding="6" align="center">';
foreach ($sql as $i => $query) {
$row = mysqli_fetch_row(DB()->query($query))[0];
$result = DB()->fetch_row($query);
$row = array_values($result)[0]; // Get first column value
$row = ($i == 2) ? humn_size($row) : $row;
echo "<tr><td>{$lang['TR_STATS'][$i]}</td><td><b>$row</b></td>";
}