Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7796147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:16:57+00:00 2026-06-01T23:16:57+00:00

So I am stuck once again on this this is my code for a

  • 0

So I am stuck once again on this this is my code for a .JSP page where I am trying to click on an artist name and it will show movies that they appear in. I have everything working in the first query but when I get to the queryMovies, where I try to a href the title of the movie back to a movie ID which should take me to another page, I get the error mid cannot be resolved to a variable. What am I doing wrong? Thanks.

    <html>
<head>
<%@ include file="header.htm" %>
<%@ page import="java.sql.*" %>
<%
    Class.forName("com.mysql.jdbc.Driver").newInstance();
    String cs="jdbc:mysql://localhost:3306/hunters?user=root&password=password";
    Connection cxn = DriverManager.getConnection(cs);
    Statement stm = cxn.createStatement();

int oscar = 0;

String fname = request.getParameter("fname");
String lname = "", dob = "", nation = "", imdb = "", url = "", newaid = "", title = "", studio = "", role = "", rlsdate = "";
String queryArtist = "SELECT * FROM artist WHERE aid = '" + request.getParameter("selectedName") + "';";

ResultSet rsArtist = stm.executeQuery(queryArtist);

    rsArtist.next();
    fname = rsArtist.getString("fname"); 
    lname = rsArtist.getString("lname");
    dob = rsArtist.getString("dob").substring(0,4);
    nation = rsArtist.getString("nation");
    imdb = rsArtist.getString("imdb");
    url = rsArtist.getString("url");
%>
    <title><%= fname %> <%= lname %></title>

<h2><FONT COLOR="B22222"><%= fname%> <%= lname%></FONT></h2>

<p>Born in: <%= dob%></p> 
<p>Nationality: <%= nation%></p>
<p>IMDB Bio: <a href="http://www.imdb.com/name/<%= imdb%>/"  target="_blank">http://www.imdb.com/name/<%= imdb%>/</a></p>
<%
if (url == null)
{
out.println("<br />");
}
else 
{
out.println("Website: <a href=" + url + "target=_blank>" + url + "</a><br>");
}
%>
<hr />
<h3><FONT COLOR="B22222">Filmography</FONT></h3>
<%
newaid = request.getParameter("selectedName");



String queryMovies = "SELECT * FROM artist, movies, artistmovie WHERE artistmovie.mid = movies.mid AND artist.aid = artistmovie.aid AND artist.aid = '"; 
    queryMovies += request.getParameter("selectedName") + "';";

ResultSet rsMovies = stm.executeQuery(queryMovies);

while(rsMovies.next())
{
    title = rsMovies.getString("title");
    studio = rsMovies.getString("studio");
    rlsdate = rsMovies.getString("rlsdate");
    role = rsMovies.getString("role");
    oscar = rsMovies.getInt("oscar");
    mid = rsMovies.getInt("mid");

    out.println("<tr><td>&nbsp;</td><td><a href= artistmovie.jsp?SelectedTitle=" + mid + ">" + title + " <a/></td>");
    out.println("<td>&nbsp;&nbsp;&nbsp;</td><td>(" + studio + "</a></td>"); 
    out.println("<td></td><td>" + rlsdate + ")</td>");  
    out.println("<td>&nbsp;&nbsp;</td><td>" + role + "</td></br></br>");

}
if (oscar == 0)
{
    out.println("<td>&nbsp;</td><td><br /></td>");
}
else
{
    out.println("<td>&nbsp;</td><td>Won oscar</td></tr>");
}
%>
<%@ include file="footer.htm" %>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:16:59+00:00Added an answer on June 1, 2026 at 11:16 pm

    Changing

    out.println("<tr><td>&nbsp;</td><td><a href= artistmovie.jsp?SelectedTitle=" + mid + ">" + title + " <a/></td>");
    

    to

    out.println("<tr><td>&nbsp;</td><td><a href=\"artistmovie.jsp?SelectedTitle="+ mid +"\">" + title + " <a/></td>");
    

    should work.

    Other than this

    out.println("<td>&nbsp;&nbsp;&nbsp;</td><td>(" + studio + "</a></td>"); 
    

    where are you starting “<a>” tag which is ending near “<td>“.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to self-teach myself C++, and once again I got stuck on something
Ok. I'm stuck once again and it seems that internet just ran out of
Sometimes I still get stuck trying to translate procedural code into functional code. Is
Ok so I am stuck once again here is what I have public static
I am once again stuck with a jQuery issue, and I'm hoping for some
I m stuck with this error: Code Sign error: Certificate identity 'iPhone Developer: My
I'm porting some code from lisp, but I got stuck at this part (apparently
I come to you for help once again, Stack Overflow. This time I have
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
Im stuck with this little project in C# but basically my problem is this:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.