0

谁能告诉我如何获得 project_title、project_id、level_of_want 和 selection_id 的值。当我提交这个我得到没有选择数据库错误。

$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);
4

2 回答 2

1

连接到 mysql 服务器基础后,您应该使用mysql_select_db函数显式选择数据库

于 2012-05-30T12:32:06.133 回答
1
mysql_select_db($bd);

我们需要看看你是如何连接的

于 2012-05-30T12:38:53.490 回答