don't run stupid queries

This commit is contained in:
Niko Storni 2022-06-17 18:54:42 +02:00
parent d3cd0e13f6
commit fdecf39f93

View file

@ -327,7 +327,7 @@ class MainController extends AppController {
$page = intval($this->request->query('page')); $page = intval($this->request->query('page'));
$conn = ConnectionManager::get('default'); $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); $count = $stmt->fetch(\PDO::FETCH_OBJ);
$numBlocks = $count->Total; $numBlocks = $count->Total;