-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
59 lines (55 loc) · 1.81 KB
/
config.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
<?php
$conn = mysqli_connect('localhost','root','','donationsystem');
if($conn){
echo "Connection successfull";
}
else{
echo "Connection Failed!";
}
$q3 = "CREATE TABLE items (item_id integer NOT NULL, item_name varchar(40) NOT NULL,
category varchar(15),brand varchar(15),quantity integer(4),
item_weight integer(3),
primary key(item_id)
)";
$r3 = mysqli_query($conn,$q3);
if($r3){
echo "<br>'items' table created successfully";
}
else{
echo "<br>Table creation failed";
}
/*
$q1 = "CREATE TABLE user (uid integer NOT NULL, uname varchar(20) NOT NULL,
uemail varchar(40) NOT NULL, user_password varchar(10) NOT NULL,
primary key(uid)
)";
$r1 = mysqli_query($conn,$q1);
if($r1){
echo "<br>Table created successfully";
}
else{
echo "<br>Table creation failed";
}
$q2 = "INSERT INTO user VALUES(1,'Aditi','[email protected]','123xyz')";
$r2 = mysqli_query($conn,$q2);
if($r2){
echo "<br>Data Inserted successfully";
}
else{
echo "<br>Data Insertion failed";
}
$q3 = "CREATE TABLE items (item_id integer NOT NULL, item_name varchar(40) NOT NULL,
category varchar(15),brand varchar(15),quantity integer(4),
item_weight integer(3),
primary key(item_id)
)";
$r3 = mysqli_query($conn,$q3);
if($r3){
echo "<br>'items' table created successfully";
}
else{
echo "<br>Table creation failed";
}
*/
mysqli_close($conn);
?>