-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
55 lines (53 loc) · 1.49 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<title>
Attendance Sheet
</title>
<style type="text/css">
table{
border-collapse: collapse;
width: 100%;
color:#d96459;
font-family :monospace;
font-size: 25px;
text-align: left;
}
th{
background-color: #d96459;
color: white;
}
</style>
</head>
<body>
<h2 style="text-align: center; color:#d96459;">Attendance Sheet</h2>
<table>
<th>
Name
</th>
<th>
Date
</th>
<th>
Time
</th>
<?php
$conn=mysqli_connect("localhost","root","","attendance");
if($conn-> connect_error){
die("Connection Failed:". $conn->connect_error);
}
$sql= "SELECT Name,Date,Time from results";
$result=$conn->query($sql);
if($result -> num_rows >0){
while($row=$result->fetch_assoc()){
echo "<tr><td>".$row["Name"]."</td><td>". $row["Date"] . "</td><td>" .$row["Time"] . "</td></tr>";
}
echo "</table>";
}
else{
echo "0 result";
}
?>
</table>
</body>
</html>