我有以下代码可以执行我想要的操作。但是,我需要第二个条件,其中表项目中接受的列等于是。我不知道如何将它输入到我当前的连接中,因为用户表的位置。
$query_Name = "SELECT u.Student_Surname, u.Student_Forename, Project_Title, Project_id
FROM users u
INNER JOIN projects p2 ON u.id = p2.Project_Lecturer
INNER JOIN project_course pc ON p2.Project_id = pc.Proj_id
INNER JOIN courses c ON pc.Cour_id = c.Course_id
INNER JOIN users u2 ON c.Code = u2.Course
WHERE u2.Username = ".$_SESSION['MM_Username']."
ORDER BY Project_id ASC" ;