mirror of
https://github.com/torrentpier/torrentpier
synced 2025-07-05 20:41:41 -07:00
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:
parent
a33574c28f
commit
728116d6dc
1 changed files with 2 additions and 1 deletions
|
@ -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>";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue