-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
37 lines (31 loc) · 922 Bytes
/
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
<?php
// database connection
include_once("config.php");
// Fetch all users data from database
$result = mysqli_query($mysqli, "SELECT * FROM users ORDER BY id DESC");
?>
<html>
<head>
<title>CRUD | Homepage</title>
</head>
<body>
<a href="add.php">Add New User</a><br/><br/>
<table width='80%' border=1 style="font-family: "Lucida Console", Courier, monospace;">
<tr>
<th>Name</th>
<th>Mobile</th>
<th>Email</th>
<th>Update</th>
</tr>
<?php
while($user_data = mysqli_fetch_array($result)) {
echo "<tr>";
echo "<td>".$user_data['name']."</td>";
echo "<td>".$user_data['mobile']."</td>";
echo "<td>".$user_data['email']."</td>";
echo "<td><a href='edit.php?id=$user_data[id]'>Edit</a> | <a href='delete.php?id=$user_data[id]'>Delete</a></td></tr>";
}
?>
</table>
</body>
</html>