query("UPDATE students SET blackboard=blackboard+1 WHERE mnumber=" . trim($_POST['mnumber'])); block("lightgreen", "added blackboard"); } if ($db->query("SELECT COUNT(*) FROM students")->fetch(PDO::FETCH_NUM)[0] == 0) { block("red", "no students registered"); exit; } block("black", "add blackboard"); ?>
Matr.nummer:
query("SELECT firstname, lastname, mnumber, blackboard FROM students"); print ""; while ($student = $result->fetch(PDO::FETCH_ASSOC)) { print ""; print ""; print ""; print ""; print ""; print ""; } print "
" . $student['firstname'] . " " . $student['lastname'] . "  " . $student['mnumber'] . "  " . $student['blackboard'] . "
"; ?>