-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcourse2.php
67 lines (57 loc) · 1.8 KB
/
course2.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
<?php
include_once 'header.php';
session_start();
$conn = mysqli_connect("localhost", "root", "", "is181_assignment");
$id = $_SESSION['Userid'];
$sql = "SELECT * FROM courses WHERE Userid=$id";
$result = mysqli_query($conn, $sql);
?>
<style>
table {
text-align: left;
align-content: center;
justify-content: center;
/* margin: 7% 32%; */
background-color: #3ddad7;
box-shadow: -10px 7px #69868a;
border-radius: 10px;
margin-top: 5%;
width: 70%;
}
</style>
<table border="1px" style="border-collapse: collapse;" align="center">
<tr>
<th>Course Name</th>
<th>Course Code</th>
<th>Description</th>
<th>Department</th>
<th>Semister</th>
<th>Academic Year</th>
<th>Course Instructor</th>
<th>Result</th>
</tr>
<?php
if (mysqli_num_rows($result) >= 1) {
while ($row = mysqli_fetch_assoc($result)) {
?>
<tr>
<td><?php echo $row['Name'] ?></td>
<td><?php echo $row['Code'] ?></td>
<td><?php echo $row['Desc'] ?></td>
<td><?php echo $row['Dept'] ?></td>
<td><?php echo $row['Sem'] ?></td>
<td><?php echo $row['Year'] ?></td>
<td><?php echo $row['Instructor'] ?></td>
<td><?php echo $row['Result'] ?></td>
</tr>
<?php
}
?>
</table>
<?php
} else {
echo "Records Not Found";
}
?>
</body>
<script src="assets/js/uswds.min.js"></script>