summaryrefslogtreecommitdiff
path: root/lib/deck/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/deck/index.php')
-rw-r--r--lib/deck/index.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/deck/index.php b/lib/deck/index.php
index 7a125e2..ad497d5 100644
--- a/lib/deck/index.php
+++ b/lib/deck/index.php
@@ -15,9 +15,9 @@ $fdefaults = array (
$decks = array();
$n = sql(
- "SELECT decks.id AS id, decks.name AS name, account.login AS owner, 0 AS nbUsers ".
- "FROM decks LEFT JOIN account ON decks.owner = account.id ".
- "ORDER BY " . get_filter("order") . " " . get_filter("way")
+ "SELECT decks.id AS id, decks.name AS name, account.login AS owner, COUNT(deck_study.id) AS nbUsers ".
+ "FROM decks LEFT JOIN account ON decks.owner = account.id LEFT JOIN deck_study ON deck_study.deck = decks.id ".
+ "GROUP BY decks.id ORDER BY " . get_filter("order") . " " . get_filter("way")
);
while ($nn = mysql_fetch_assoc($n)) $decks[] = $nn;