-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay_DB.php
More file actions
49 lines (41 loc) · 853 Bytes
/
Copy pathdisplay_DB.php
File metadata and controls
49 lines (41 loc) · 853 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>Display Data from DB</title>
<style type="text/css">
table{
border: 2px solid red;
background-color: #FFC;
}
th{
border-bottom: 5px solid #000;
}
td{
border-bottom: 2px solid #555;
}
</style>
</head>
<body>
<h1>Display Data from Database</h1>
<?php
include('db_connection.php');
$sqlget = "SELECT * FROM users";
$result = mysqli_query($conn, $sqlget) or die('error getting data');
echo "<table>";
echo "<tr>
<th>ID</th><th>Name</th><th>Email</th>
</tr>";
require_once('page_no.php');
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo "<tr><td>";
echo $row['id'];
echo "</td><td>";
echo $row['name'];
echo "</td><td>";
echo $row['email'];
echo "</td></tr>";
}
echo "</table>";
?>
</body>
</html>