-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeleteitem.php
More file actions
129 lines (104 loc) · 2.12 KB
/
deleteitem.php
File metadata and controls
129 lines (104 loc) · 2.12 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
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
<!DOCTYPE html>
<html>
<head>
<title>Delete item </title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: Arial, Helvetica, sans-serif;
}
/* Style the header */
header {
background-color: #666;
padding: 30px;
text-align: center;
font-size: 35px;
color: white;
}
/* Create two columns/boxes that floats next to each other */
nav {
float: left;
width: 30%;
height: 300px; /* only for demonstration, should be removed */
background: #ccc;
padding: 20px;
}
/* Style the list inside the menu */
nav ul {
list-style-type: none;
padding: 0;
}
article {
float: left;
padding: 20px;
width: 70%;
background-color: #f1f1f1;
height: 300px; /* only for demonstration, should be removed */
}
/* Clear floats after the columns */
section:after {
content: "";
display: table;
clear: both;
}
/* Style the footer */
footer {
background-color: #777;
padding: 10px;
text-align: center;
color: white;
}
/* Responsive layout - makes the two columns/boxes stack on top of each other instead of next to each other, on small screens */
@media (max-width: 600px) {
nav, article {
width: 100%;
height: auto;
}
}
</style>
</head>
<body
<div id="frm">
<header>
<h2>DELETE ITEM</h2>
</header>
<footer>
<form action="delitem.php" method="POST">
<p>
<label><b>Name:</b></label>
<input type="text" id="name" name="name"/>
</p>
<p>
<input type="submit" id="btn" name="items"/>
</p>
</form>
</div>
</footer>
<nav>
</nav>
<article>
<?php
$db_username = 'root';
$db_password = '';
$db_name = 'users';
$db_host = 'localhost';
//connect to MySql
$mysqli = new mysqli($db_host, $db_username, $db_password,$db_name);
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
$sql = "SELECT name FROM product";
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
// output data of each row
$count=0;
while($row = $result->fetch_assoc()) {
$count=$count+1;
echo " <br><b>Item No :</b> ".$count."<br>"."<br> NAME: ". $row["name"]; }
}
?>
</article>
</body>
</html>