-
Notifications
You must be signed in to change notification settings - Fork 15
/
onstart.php
158 lines (135 loc) · 5.1 KB
/
onstart.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?php
$connection = mysqli_connect("localhost","root","");
mysqli_query($connection,"CREATE DATABASE geekhav") ;
mysqli_select_db($connection,'geekhav');
$query = "CREATE TABLE social_handles (
`social_handles_id` varchar(255),
`github` varchar(255),
`mail` varchar(255),
`facebook`varchar(255),
`instagram` varchar(255),
`codechef` varchar(255),
`codeforces` varchar(255),
`linkedin` varchar(255),
`hackerrank` varchar(255),
`hackerearth` varchar(255),
`twitter` varchar(255),
PRIMARY KEY (social_handles_id)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE member (
`name` varchar(255),
`roll_no` varchar(255),
`image` longblob,
`description`varchar(12000),
`member_id` varchar(255),
`hof` varchar(255),
`social_handles` varchar(255),
`cred_id` varchar(255),
`post` varchar(255),
`wing` varchar(255),
`session` varchar(255),
PRIMARY KEY (member_id),
FOREIGN KEY (social_handles) REFERENCES social_handles(social_handles_id)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE past_members (
`name` varchar(255),
`roll_no` varchar(255),
`image` longblob,
`description`varchar(12000),
`member_id` varchar(255),
`hof` varchar(255),
`social_handles` varchar(255),
`post` varchar(255),
`wing` varchar(255),
`session` varchar(255),
PRIMARY KEY (member_id),
FOREIGN KEY (social_handles) REFERENCES social_handles(social_handles_id)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE credentials (
`credentialsID` varchar(255),
`username` varchar(255),
`password` varchar(255),
`admin_value`varchar(255),
`member_id` varchar(255),
PRIMARY KEY (credentialsID),
FOREIGN KEY (member_id) REFERENCES member(member_id)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE wings (
`wing_id` varchar(255),
`wing` varchar(255),
`info` varchar(12000),
`logo` longblob,
`image` longblob,
PRIMARY KEY (wing_id)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE Projects (
`wing_id` varchar(255),
`member_id` varchar(255),
`project_name` varchar(255),
`project_link`varchar(255),
`blog_link`varchar(255),
`source_code_link`varchar(255),
`description`varchar(12000),
`image` longblob,
FOREIGN KEY (wing_id) REFERENCES wings(wing_id),
FOREIGN KEY (member_id) REFERENCES member(member_id)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE blogs (
`wing_id` varchar(255),
`member_id` varchar(255),
`blog_title` varchar(255),
`description`varchar(12000),
`blog_link`varchar(255),
`image` longblob,
FOREIGN KEY (member_id) REFERENCES member(member_id),
FOREIGN KEY (wing_id) REFERENCES wings(wing_id)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE announcements (
`member_id` varchar(255),
`name` varchar(255),
`organizer`varchar(255),
`venue`varchar(255),
`date`varchar(255),
`time`varchar(255),
`topic`varchar(255),
`details`varchar(12000),
`link`varchar(255),
`attachment`varchar(255),
`image` longblob,
FOREIGN KEY (member_id) REFERENCES member(member_id)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE contact (
`made_on` varchar(255),
`first_name` varchar(255),
`last_name`varchar(255),
`description`varchar(12000),
`email`varchar(255),
`mobile`varchar(255),
`gender`varchar(255)
);";
mysqli_query($connection,$query) ;
$query = "CREATE TABLE geekhavenInfo (
`name`varchar(255),
`description`varchar(12000)
);";
mysqli_query($connection,$query) ;
$query = "INSERT INTO social_handles VALUES('00000','','','','','','','','','','')";
$query_run = mysqli_query($connection,$query);
$query = "INSERT INTO member VALUES ('', '', '', '', '22222', '', '00000', '11111', 'coordinator', 'exWing', '2020')";
$query_run = mysqli_query($connection,$query);
$query = "INSERT INTO credentials VALUES('11111','exUser','exPass','1','22222')";
$query_run = mysqli_query($connection,$query);
$query = "INSERT INTO wings VALUES('33333','X','Only for Overall coordinators','','')";
$query_run = mysqli_query($connection,$query);
$query = "INSERT INTO geekhavenInfo VALUES('GeekHaven','Lorem Ipsum simply dummy of the printing typesetting industry.')";
$query_run = mysqli_query($connection,$query);
echo "Database created";
?>