-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_users.php
More file actions
51 lines (45 loc) · 1.13 KB
/
data_users.php
File metadata and controls
51 lines (45 loc) · 1.13 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
<?php
require_once 'dbh.php';
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `logindb`";
$result = $conn->query($sql);
?>
<tr>
<th scope="col">Id</th>
<th scope="col">Username</th>
<th scope="col">Password</th>
<th scope="col">Name</th>
<th scope="col">Role</th>
<th scope="col">Action</th>
</tr>
<tr>
<?php
while ($row = mysqli_fetch_assoc($result)) {
?>
<td>
<?php echo $row["Id"]; ?>
</td>
<td>
<?php echo $row["username"]; ?>
</td>
<td>
<?php echo $row["password"]; ?>
</td>
<td>
<?php echo $row["name"]; ?>
</td>
<td>
<?php echo $row["role"]; ?>
</td>
<form action="code.php" method="post">
<input type="hidden" name="id" value="<?php echo $row['Id'] ?>">
<td><input type="submit" name="delete" class="btn btn-danger" value="delete"></td>
</form>
</tr>
<?php
}
$conn->close();
?>