query("SELECT firstname, lastname, mnumber, blackboard FROM students ORDER BY lastname"); print "
First name | Last name | Matr.nummer | Examples | Blackboard | "; while ($student = $result->fetch(PDO::FETCH_ASSOC)) { $result2 = $db->query("SELECT manydone, thisdone FROM workdone WHERE mnumber=" . $student['mnumber'] . " AND session=" . $SESSIONS_actual)->fetch(PDO::FETCH_NUM); $exdone = $result2[0]; if ($exdone == "") { $exdone=0; } $thisdone = $result2[1]; print "
" . $student['firstname'] . " | "; print "" . $student['lastname'] . " | "; print "" . $student['mnumber'] . " | "; print "" . $thisdone . " (" . $exdone . "/" . $SESSIONS[$SESSIONS_actual]['nexamples'] . ") | "; print "" . $student['blackboard'] . " | "; print "