-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUsers.php
55 lines (46 loc) · 1.5 KB
/
Users.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
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="en">
<head>
<title>All users</title>
<link rel="stylesheet" href="style.css?v=<?php echo time(); ?>">
</head>
<body>
<section>
<!-- Navigation bar -->
<header>
<a href="http://localhost:8080/Task1/MainPage.php" class="logo"><- Home</a>
<div class="toggle"></div>
<ul class="navigation">
<li><a href="#" class="active">View Customers</a></li>
<li><a href="http://localhost:8080/Task1/Transfer.html">Transfer money</a></li>
<li><a href="http://localhost:8080/Task1/Histroy.php">History</a></li>
</ul>
</header>
<!-- Building connection with mysql database -->
<?php
$servername = "localhost";
$username = "root";
$password = "";
$conn = mysqli_connect($servername, $username, $password,"mno_bank");
$sql = "SELECT * FROM all_users";
$result = $conn->query($sql);
echo "<table>";
echo "<tr>";
echo "<th>User ID</th>";
echo "<th>Name</th>";
echo "<th>Email</th>";
echo "<th>Balance</th>";
echo "</tr>";
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "<tr><td>" . $row["User_ID"] . "</td><td>" . $row["NAME"] . "</td><td>" . $row["Email"] . "</td><td>" . $row["Balance"] . "</td></tr><br>";
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
</section>
</body>
</html>