-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresetMessage.php
More file actions
41 lines (28 loc) · 1.31 KB
/
Copy pathresetMessage.php
File metadata and controls
41 lines (28 loc) · 1.31 KB
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
<?php
include("myCredentials.php");
$con = mysqli_connect($servername, $username, $password, $dbname);
if(!$con) {
die("Connection failed: " . mysqli_connect_error());
}
$reset= " DROP TABLE IF EXISTS user CASCADE;
DROP TABLE IF EXISTS message CASCADE;
CREATE TABLE user (
id int(4) NOT NULL auto_increment,
uname varchar(25) NOT NULL,
fname varchar(25) NOT NULL,
lname varchar(25) NOT NULL,
pw varchar(25) NOT NULL,
isAdmin BIT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE message (
id int(4) NOT NULL auto_increment,
uname varchar(25) NOT NULL,
message varchar(200),
PRIMARY KEY (id)
);
INSERT INTO user VALUES (NULL, 'steinem', 'Erin', 'Stein', 'pw1234', 1), (NULL, 'doejq', 'John', 'Doe', 'myPWisSafe', 0), (NULL, 'smithjd', 'James', 'Smith', 'Pw1Fh89E(38fj)LK', 0);
INSERT INTO message VALUES (NULL, 'steinem', 'This is the first message!'), (NULL, 'doejq', 'I am John Doe'), (NULL, 'smithjd', 'The name is Smith, James Smith.');";
mysqli_query($con, $reset);
mysqli_close($con);
?>