Willkommen statistik
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user