好的,我已经看了又看,哈哈,我遇到了问题。这是我的代码的最后一部分,显示演员的电影,我已经建立了一个 SQL 数据库,其中包含这些信息。虽然当我显示为网页时,我只看到每个演员一部电影,其中一些演员至少有三部任何建议或帮助?希望这不是愚蠢的大声笑我对此很陌生。
<h3><FONT COLOR="B22222">Filmography</FONT></h3>
<%
newaid = request.getParameter("selectedName");
String queryFilm = "SELECT * FROM artist, movies, artistmovie WHERE artistmovie.mid = movies.mid AND artist.aid = artistmovie.aid AND artist.aid = '";
queryFilm += request.getParameter("selectedName") + "';";
ResultSet rsFilm = stm.executeQuery(queryFilm);
while(rsFilm.next())
{
title = rsFilm.getString("title");
studio = rsFilm.getString("studio");
rlsdate = rsFilm.getString("rlsdate");
role = rsFilm.getString("role");
oscar = rsFilm.getInt("oscar");
}
out.println("<tr><td> </td><td>" + title + "</td>");
out.println("<td> </td><td>(" + studio + "</a></td>");
out.println("<td></td><td>" + rlsdate + ")</td>");
out.println("<td> </td><td>" + role + "</td>");
if (oscar == 0)
{
out.println("<td> </td><td><br /></td>");
}
else
{
out.println("<td> </td><td>Won oscar</td></tr>");
}
%>
</body>
</html>