任何人都可以告訴我如何獲得project_title,project_id,level_of_want和selection_id的值。當我提交這個我得到沒有數據庫選擇錯誤。php加入多個表的查詢
$query_Name = "SELECT u.Student_Surname, u.Student_Forename, p2.Project_Title,
p2.Project_id, s.level_of_want, s.selection_id
FROM users u
INNER JOIN projects p2 ON u.id = p2.Project_Lecturer
INNER JOIN selection s ON p2.Project_id = s.id_project
INNER JOIN users u2 ON s.student_id = u2.id
WHERE u2.Username = ".$_SESSION['MM_Username']." ORDER BY selection_id ASC" ;
$Name = mysql_query($query_Name, $projectsite) or die(mysql_error());
$row_Name = mysql_fetch_assoc($Name);
$totalRows_Name = mysql_num_rows($Name);
你打開帶有mysql_select_db和的mysql_connect一個數據庫連接之前? – Sebas