-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11-index.php
42 lines (41 loc) · 1.01 KB
/
11-index.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
<?php
$conn = require '11-connection.php';
$result = $conn->query("SELECT * FROM users");
$users = $result->fetch_all(MYSQLI_ASSOC);
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CRUD</title>
</head>
<body>
<h1>List Users</h1>
<table>
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Email</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user):?>
<tr>
<td><?=$user["id"]?></td>
<td><?=$user["name"]?></td>
<td><?=$user["email"]?></td>
<td><a href="11-show.php?id=<?=$user["id"]?>">Show</a></td>
<td><a href="11-edit.php?id=<?=$user["id"]?>">Edit</a></td>
<td><a href="11-delete.php?id=<?=$user["id"]?>">Delete</a></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<p><a href="11-create.php">--> Add User <--</a></p>
</body>
</html>