[web-master] main: No need to calculate total three times

From: Date: Mon, 26 Aug 2024 23:42:19 +0000
Subject: [web-master] main: No need to calculate total three times
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-32018@lists.php.net to get a copy of this message
Author: Derick Rethans (derickr) Date: 2024-08-26T10:01:16+01:00 Commit: https://github.com/php/web-master/commit/3b30d6613f77b872899b3635b83b0f87c85e171e Raw diff: https://github.com/php/web-master/commit/3b30d6613f77b872899b3635b83b0f87c85e171e.diff No need to calculate total three times Changed paths: M scripts/email-note-summaries Diff: diff --git a/scripts/email-note-summaries b/scripts/email-note-summaries index 1fa124f..5a03be6 100755 --- a/scripts/email-note-summaries +++ b/scripts/email-note-summaries @@ -46,9 +46,6 @@ foreach ($result as $row) { $table .= sprintf("%5d | https://php.net/manual/en/%s.php#%s\n", $row['weight'], $row['sect'], $row['note_id']); } -$query = "SELECT COUNT(*) FROM note"; -$total = $pdo->single($query); - $body .= "Following are the top " . LIMIT. " notes with the highest rating, sorted by rating.\n" . "These notes are prime candidates for being integrated into the manual.\n\n" . $table; @@ -68,9 +65,6 @@ foreach ($result as $row) { $table .= sprintf("%5d | https://php.net/manual/en/%s.php#%s\n", $row['weight'], $row['sect'], $row['note_id']); } -$query = "SELECT COUNT(*) FROM note"; -$total = $pdo->single($query); - $body .= "Following are the bottom " . LIMIT. " notes with the lowest rating, sorted by rating.\n" . "These notes are prime candidates for being removed.\n\n" . $table;

« previous php.webmaster (#32018) next »