From 5ff32fae1a790c3540b1b85b1584ac1932e22670 Mon Sep 17 00:00:00 2001 From: Lan Hui Date: Fri, 1 Sep 2023 18:50:26 +0800 Subject: [PATCH] SubmitLab.php: make SQL statement look cleaner --- SubmitLab.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SubmitLab.php b/SubmitLab.php index 4a871b3..c8ba525 100644 --- a/SubmitLab.php +++ b/SubmitLab.php @@ -27,7 +27,9 @@ include 'Header.php'; $row = mysqli_fetch_assoc($result0); $course_name = $row['Course_Name']; - $result1 = mysqli_query($con," SELECT `Type`, `Lab_Report_ID`, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4` FROM `lab_reports_table` WHERE Lab_Report_ID=$id and Deadline > '$c_date' ORDER by Lab_Report_ID DESC"); + $result1 = mysqli_query($con, "SELECT Type, Lab_Report_ID, Course_ID, Posted_Date, Deadline, Instructions, Title, Attachment_link_1, Attachment_link_2, Attachment_link_3, Attachment_link_4 + FROM lab_reports_table + WHERE Lab_Report_ID=$id AND Deadline>'$c_date' ORDER BY Lab_Report_ID DESC"); if(mysqli_num_rows($result1) == 0) { echo "No active assignments for this course so far.";