From 4b3565b9aa1affb5dbf7cce3e694d07159949cc7 Mon Sep 17 00:00:00 2001 From: ruan Date: Thu, 31 May 2018 09:01:20 +0200 Subject: [PATCH] history.php: Simplify addition --- history.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/history.php b/history.php index 70246de..bbb39e5 100644 --- a/history.php +++ b/history.php @@ -113,15 +113,15 @@ try { $total = 0; $count_st = $page->conn->prepare("SELECT - (SELECT COUNT(*) FROM $t_bans WHERE $field=:uuid0) as c_bans, - (SELECT COUNT(*) FROM $t_mutes WHERE $field=:uuid1) as c_mutes, - (SELECT COUNT(*) FROM $t_warnings WHERE $field=:uuid2) as c_warnings, - (SELECT COUNT(*) FROM $t_kicks WHERE $field=:uuid3) as c_kicks + (SELECT COUNT(*) FROM $t_bans WHERE $field=:uuid0) + + (SELECT COUNT(*) FROM $t_mutes WHERE $field=:uuid1) + + (SELECT COUNT(*) FROM $t_warnings WHERE $field=:uuid2) + + (SELECT COUNT(*) FROM $t_kicks WHERE $field=:uuid3) as total "); for ($i = 0; $i <= 3; $i++) $count_st->bindParam(":uuid$i", $uuid, PDO::PARAM_STR); if ($count_st->execute() && ($row = $count_st->fetch()) !== null) { - $total = $row['c_bans'] + $row['c_mutes'] + $row['c_warnings'] + $row['c_kicks']; + $total = $row['total']; } $count_st->closeCursor();