-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_coursesSQL.php
More file actions
45 lines (31 loc) · 1.46 KB
/
_coursesSQL.php
File metadata and controls
45 lines (31 loc) · 1.46 KB
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
<?php
$sql = "SELECT * FROM `courses`";
$result = mysqli_query($con, $sql);
if ($result) {
for ($i=0; $i < 10 && $row = mysqli_fetch_assoc($result); $i++) {
$courseID = $row['courseID'];
$courseTitle = $row['courseTitle'];
// $courseDescription = $row['courseDescription'];
$coursePrice = $row['coursePrice'];
$courseDP = $row['courseDP'];
// $courseTableName = $row['courseTableName'];
$teacherID = $row['teacherID'];
$sql = "SELECT * FROM `student-course-junction` WHERE `studentID`=$studentID AND `courseID`=$courseID";
$reC = mysqli_query($con, $sql);
if ($reC) {
$nor = mysqli_num_rows($reC);
if ($nor == 0) {
$sql = "SELECT * FROM `teachers` WHERE `teacherID`='$teacherID'";
$res = mysqli_query($con, $sql);
if ($res) {
$roT = mysqli_fetch_assoc($res);
// $teacherID = $roT['teacherID'];
$teacherName = $roT['teacherName'];
$teacherDesignation = $roT['teacherDesignation'];
include "_courseCard.php";
}
}
}
}
}
?>