From f69de29353a4dd3121233d01e6c4e95fb15faa3a Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 24 May 2025 13:45:27 -0400 Subject: [PATCH] Get a more accurate count of Tables rows in Debug using count instead of relying on show table status as this is not accurate all the time. --- admin_debug.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/admin_debug.php b/admin_debug.php index dcb11792..7c49bf90 100644 --- a/admin_debug.php +++ b/admin_debug.php @@ -296,7 +296,13 @@ if ($tablesResult) { while ($table = $tablesResult->fetch_assoc()) { $tableName = $table['Name']; - $tableRows = $table['Rows']; + + // Accurate row count + $countResult = $mysqli->query("SELECT COUNT(*) AS cnt FROM `$tableName`"); + $countRow = $countResult->fetch_assoc(); + $tableRows = $countRow['cnt']; + $countResult->free(); + $dataLength = $table['Data_length']; $indexLength = $table['Index_length']; $tableSize = ($dataLength + $indexLength) / (1024 * 1024); // Size in MB @@ -336,11 +342,6 @@ if ($tablesResult) { 'name' => 'Total database size (MB)', 'value' => round($totalSize, 2) . ' MB', ]; -} else { - $databaseStats[] = [ - 'name' => 'Database connection error', - 'value' => $mysqli->error, - ]; } // Section: Database Structure Comparison