Willkommen statistik

This commit is contained in:
Felix Ivo
2025-06-30 10:26:39 +02:00
parent fc17a1a312
commit ba9ec6b430
3 changed files with 55 additions and 3 deletions

View File

@@ -69,4 +69,17 @@ class UserModel extends Database
return ['success' => false, 'message' => 'An error occurred during registration.'];
}
}
function getUserCount() {
$pdo = $this->linkDB();
if (!$pdo) return 0;
try {
$stmt = $pdo->prepare("SELECT COUNT(*) FROM users");
$stmt->execute();
return $stmt->fetchColumn();
} catch (PDOException $e) {
error_log("Get User Count Error: " . $e->getMessage());
return 0;
}
}
}