summaryrefslogtreecommitdiff
path: root/lib/deck/index.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:07:29 +0200
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-09-18 12:07:29 +0200
commita565e649898c629874ef812a13806b1c384f68e4 (patch)
treeafc03ed12ec7e82ce17bcfff5ba76440ff43eb97 /lib/deck/index.php
parent8d9321225140a3db0b72796d4d0236d6cacfeb8a (diff)
downloadBits-a565e649898c629874ef812a13806b1c384f68e4.tar.gz
Bits-a565e649898c629874ef812a13806b1c384f68e4.zip
Added study program. Yay!
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;