I need to pass a value with a querystring to another page and run a query based on it.
Example:
Page 1
I would click on the following link.
<a href="deleteCD.jsp?cd_id=<%= search.getCDID() %>">Delete</a>
Page 2
I have this for my SQL in my DeleteCDBean.java file:
String cdid = "";
ResultSet results = statement.executeQuery(
"SELECT * FROM CD, ARTIST, GENRE, ADVISORY, LOCATION WHERE CD.ARTIST_ID = ARTIST.ARTIST_ID AND CD.GENRE_ID = GENRE.GENRE_ID AND CD.ADVISORY_ID = ADVISORY.ADVISORY_ID AND CD.LOCATION_ID = LOCATION.LOCATION_ID AND CD_ID = " + cdid + " ");
I also have this to get the value from the URL:
<%
String cdid = request.getParameter("cd_id");
%>
For some reason I can't get the cd_id that is passed from the 1st page to insert itself into the SQL.
Any suggestions?