-
Notifications
You must be signed in to change notification settings - Fork 0
/
students.php
63 lines (52 loc) · 1.52 KB
/
students.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
56
57
58
59
60
61
62
63
<html>
<head>
</head>
<style>
.btn{
background-color: #5184a0; /* Green */
border: none;
color: white;
padding: 15px 16px;
text-align: center;
text-decoration: none;
font-size: 16px;
border-radius: 12px;
box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);
}
</style>
<body style="background-color:#C8F5F5">
<?php
try
{
$conn = mysqli_connect("localhost", "root", "", "blood_bank");
$sql="SELECT * FROM students order by BLOOD_GROUP ";
$res=mysqli_query($conn, $sql);
echo "<table border='1'>
<tr>
<th>REGISTER NUMBER</th>
<th>NAME</th>
<th>BLOOD GROUP</th>
<th>PHONE</th>
<th>EMAIL</th>
<th>CITY</th>
</tr>";
while($row=mysqli_fetch_assoc($res))
{
echo "<tr>";
echo "<td>" . $row['REGISTER_NO'] . "</td>";
echo "<td>" . $row['FULL_NAME']. "</td>";
echo "<td>" . $row['BLOOD_GROUP']. "</td>";
echo "<td>" . $row['PHONE']. "</td>";
echo "<td>" . $row['EMAIL'] . "</td>";
echo "<td>" . $row['CITY']. "</td>";
}
echo "</table";
}
catch(Exception $e)
{
echo "FAILED TO CONNECT DATABASE";
}
?>
<p><form action="index.html"><button class="btn"> EXIT</button></form></p>
</body>
</html>