From 6f689a229630e7acb43557c61ab522706047ed05 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Wed, 6 Sep 2023 19:40:30 +0800 Subject: [PATCH] Courses.php: format SQL code --- Courses.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Courses.php b/Courses.php index a42c828..617c01a 100644 --- a/Courses.php +++ b/Courses.php @@ -11,7 +11,7 @@ include 'Header.php';
@@ -352,15 +352,17 @@ include 'Header.php'; echo "

My courses

"; - $result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members`, users_table.Full_Name FROM `courses_table` INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID where courses_table.Lecturer_User_ID=$user_d ORDER BY Academic_Year DESC, URL ASC"); - - if($_SESSION['user_type']=="TA") - { - $result = mysqli_query($con,"SELECT course_ta.Course_ID, `Course_Name`, - `Academic_Year`, `Faculty`, `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` FROM `courses_table` -INNER JOIN -course_ta ON course_ta.Course_ID=courses_table.Course_ID where course_ta.TA=$user_d"); + $result = mysqli_query($con, "SELECT Course_ID, Course_Name, Academic_Year, Faculty, Lecturer_User_ID, TA_User_ID, Course_Code, URL, Verify_New_Members, users_table.Full_Name + FROM courses_table + INNER JOIN users_table ON users_table.User_ID=courses_table.Lecturer_User_ID + WHERE courses_table.Lecturer_User_ID=$user_id + ORDER BY Academic_Year DESC, URL ASC"); + if ($_SESSION['user_type'] == "TA") { + $result = mysqli_query($con, "SELECT course_ta.Course_ID, Course_Name, Academic_Year, Faculty, Lecturer_User_ID, TA_User_ID, Course_Code, URL, Verify_New_Members + FROM courses_table + INNER JOIN course_ta ON course_ta.Course_ID=courses_table.Course_ID + WHERE course_ta.TA=$user_id"); } if(mysqli_num_rows($result) != 0)