From fdecf39f9377eb215e192fa412de9c232ca262de Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Fri, 17 Jun 2022 18:54:42 +0200 Subject: [PATCH] don't run stupid queries --- src/Controller/MainController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index ca4b418..b5376e7 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -327,7 +327,7 @@ class MainController extends AppController { $page = intval($this->request->query('page')); $conn = ConnectionManager::get('default'); - $stmt = $conn->execute('SELECT COUNT(id) AS Total FROM block'); + $stmt = $conn->execute('SELECT height AS Total FROM block oder by id desc limit 1'); $count = $stmt->fetch(\PDO::FETCH_OBJ); $numBlocks = $count->Total;