$empty = true; $students = ""; $rows = $db->query("select * from Students order by lastName"); foreach ($rows as $key => $row) { $student = Student::fromRow($row); $students[$student->email] = $student; } // find active preference table $activeTables = new ActiveTables($db); $preferenceTable = $activeTables->getUniqueMatchingName('Preferences'); // do the query $nTas = 0; $preferences = ""; $rows = $db->query("select * from {$preferenceTable}"); foreach ($rows as $key => $row) { $preference = Preference::fromRow($row); $preferences[$preference->email] = $preference; $nTas = $nTas + 1; } // start page print '<article class="page">' . "\n"; print '<h1>All Active TA Preferences</h1>' . "\n"; print "<p>Number of TAs with registered preferences: {$nTas}</p>\n"; print "\n"; // print table header print "<table>\n"; print "<tr>"; print "<th> Name </th>"; print "<th> Email </th>"; print "<th> Preference 1 </th>"; print "<th> Preference 2 </th>";