diff options
author | Nicolas BERNSTEIN <alexis211@gmail.com> | 2011-09-18 12:07:29 +0200 |
---|---|---|
committer | Nicolas BERNSTEIN <alexis211@gmail.com> | 2011-09-18 12:07:29 +0200 |
commit | a565e649898c629874ef812a13806b1c384f68e4 (patch) | |
tree | afc03ed12ec7e82ce17bcfff5ba76440ff43eb97 /lib/deck/index.php | |
parent | 8d9321225140a3db0b72796d4d0236d6cacfeb8a (diff) | |
download | Bits-a565e649898c629874ef812a13806b1c384f68e4.tar.gz Bits-a565e649898c629874ef812a13806b1c384f68e4.zip |
Added study program. Yay!
Diffstat (limited to 'lib/deck/index.php')
-rw-r--r-- | lib/deck/index.php | 6 |
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; |