3 if ($db = new PDO('sqlite:banane.db')) {
4 $db->query('CREATE TABLE IF NOT EXISTS students
5 (mnumber int, firstname string, lastname string, email string, password string, blackboard int DEFAULT 0, lastblackboard TIMESTAMP, PRIMARY KEY (mnumber))');
6 $db->query('CREATE TABLE IF NOT EXISTS workdone
7 (mnumber int, session int, manydone int, thisdone string, tstamp TIMESTAMP)');
8 $db->query('CREATE TABLE IF NOT EXISTS prefs
9 (key string, value string, PRIMARY KEY (key))');
10 $db->query('CREATE TABLE IF NOT EXISTS sessions
11 (id int NOT NULL, examples string, nexamples int, PRIMARY KEY (id))');
12 $db->query('CREATE TABLE IF NOT EXISTS exams
13 (id int NOT NULL, score string, PRIMARY KEY (id))');
14 $db->query('CREATE TABLE IF NOT EXISTS examscore
15 (mnumber int, exam int, scorestr string, tstamp TIMESTAMP)');