diff --git a/index.php b/index.php index 3d5eb26b2a1bdf005cc0ba767235f6ccde756710..7fd438063dd8146d957e241297fe2e4a1132a0d9 100644 --- a/index.php +++ b/index.php @@ -15,9 +15,11 @@ $app->get( $sam = $samPics[array_rand($samPics)]; - $events = $bdd->prepare('SELECT id, title, date, place, description - FROM sam + $events = $bdd->prepare('SELECT s.id, title, date, place, description, GROUP_CONCAT(nick SEPARATOR ", ") as nicks + FROM sam s + LEFT OUTER JOIN sam_users su ON s.id = su.event WHERE date > '.time().' + GROUP BY s.id ORDER BY date'); $events->execute(); @@ -39,6 +41,7 @@ $app->get( <th>Titre</th> <th>Description</th> <th>Salle</th> + <th>Participants</th> </tr> </thead> <tbody> @@ -54,6 +57,7 @@ EOF; <td>$event[1]</td> <td>$description</td> <td>$event[3]</td> + <td>$event[5]</td> </tr> EOF; }