Commit 91e2f6f9 authored by okhin's avatar okhin 🚴

Using FETCH_COLUMN for the user id

parent b4dfbe51
Pipeline #2316 passed with stages
in 12 seconds
......@@ -91,8 +91,9 @@ class UserHandler
public function handleAdminUpdateTotalUsersCommand(AdminUpdateTotalUsersCommand $command)
// Let's get all users first
$user_ids = $this->connection->executeQuery('SELECT id FROM users')->fetchAll(\PDO::FETCH_ASSOC);
$user_ids = $this->connection->executeQuery('SELECT id FROM users')->fetchAll(\PDO::FETCH_COLUMN);
foreach ($user_ids as $user_id) {
$user_id = (int) $user_id;
$total = $this->connection->executeQuery('SELECT SUM(somme) AS total FROM dons WHERE user_id = :user_id AND STATUS IN (1, 102)', [
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment