-
Notifications
You must be signed in to change notification settings - Fork 0
/
Oneg.php
76 lines (65 loc) · 2.15 KB
/
Oneg.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
64
65
66
67
68
69
70
71
72
73
74
75
76
<html>
<head>
<title></title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<!--Import materialize.css-->
<link type="text/css" rel="stylesheet" href="static/css/materialize.min.css" media="screen,projection"/>
<link rel="stylesheet" type="text/css" href="static/prelogin.css">
</head>
<h5>Blood Group O-</h5> <br/>
<div class="a1">
<?php
session_start();
$conn=mysqli_connect("localhost","root","","blooddonation");
if(!$conn)
{
die("connection failed".mysqli_connect_error());
echo "fail";
}
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM donortable WHERE BloodGroup='O-'";
$result = $conn->query($sql);
echo "<table border='1'>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Blood Group</th>
<th>Contact</th>
<th>Address</th>
<th>Email</th>
<th>Height</th>
<th>Weight</th>
<th>DOB</th>
<th>Age</th>
<th>Gender</th>
</tr>";
if ($result->num_rows > 0) {
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['FirstName'] . "</td>";
echo "<td>" . $row['LastName'] . "</td>";
echo "<td>" . $row['BloodGroup'] . "</td>";
echo "<td>" . $row['Contact'] . "</td>";
echo "<td>" . $row['Address'] . "</td>";
echo "<td>" . $row['Email'] . "</td>";
echo "<td>" . $row['Height'] . "</td>";
echo "<td>" . $row['Weight'] . "</td>";
echo "<td>" . $row['DOB'] . "</td>";
echo "<td>" . $row['Age'] . "</td>";
echo "<td>" . $row['Gender'] . "</td>";
echo "</tr>";
}
}else {
echo "0 results";
}
echo "</table>";
$conn->close();
?>
</div>
</body>
</html>