-
Notifications
You must be signed in to change notification settings - Fork 2
/
mkdb.php
69 lines (58 loc) · 2.02 KB
/
mkdb.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
$result = mysqli_connect("localhost","thampichayan","123decipher123","decipher16");
$sql = "CREATE TABLE IF NOT EXISTS `wrong` (
`no` int(2) NOT NULL AUTO_INCREMENT,
`path` varchar(100) DEFAULT NULL,
`current` int(2) NOT NULL,UNIQUE KEY `no` (`no`)
);";
$ref = $result->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS `correct` (
`no` int(2) NOT NULL AUTO_INCREMENT,
`path` varchar(100) DEFAULT NULL,
`current` int(2) NOT NULL,UNIQUE KEY `no` (`no`)
);";
$ref = $result->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS `levels` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) DEFAULT NULL,
`als` varchar(200) DEFAULT NULL,
`title` varchar(1000) DEFAULT NULL,
`contents` varchar(1000) DEFAULT NULL,
`answer` varchar(1000) DEFAULT NULL,
`stat` int(11) DEFAULT NULL,
`misc` varchar(200) DEFAULT NULL,
UNIQUE KEY `id` (`id`)
)";
$ref = $result->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS `users` (
`fbuid` int(20) NOT NULL,
`name` varchar(200) DEFAULT NULL,
`level` int(11) DEFAULT NULL,
`passtime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`mob` varchar(20) DEFAULT NULL,
`college` varchar(200) DEFAULT NULL,
`email` varchar(200) DEFAULT NULL,
`role` int(11) DEFAULT NULL,
`validation` varchar(200) DEFAULT NULL,
`validated` int(11) DEFAULT NULL,
UNIQUE KEY `id` (`fbuid`)
);";
$ref = $result->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS `logs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` varchar(200) DEFAULT NULL,
`val` varchar(2000) DEFAULT NULL,
`level` int(11) DEFAULT NULL,
`time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `id` (`id`)
);";
$ref = $result->query($sql);
$sql = "CREATE TABLE IF NOT EXISTS `accesslogs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(20) DEFAULT NULL,
`user` varchar(200) DEFAULT NULL,
`time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `id` (`id`)
);";
$ref = $result->query($sql);
?>