Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

URL Rewritting

In a jsp file i have the following code

<TR>
<TD>" + result.getString(2) </TD>
<TD>" + result.getString(3) </TD>
<TD>" + result.getString(4) </TD>
<TD><a href=Comment?reviewid =" + reviewid + ">Add a comment</a></TD>
</TR>

In a sql i have a table with reviewID, movieTitle, review, commentID

I want to be able to link a comment with a review. So i put the reviewID in the url and the url links to a comment.

the servlet is used to display the comment but the commend is linked to all the reviews not a single one when i do it, the code i used to display is
String query = "SELECT M.reviewID, M.movieTitle, M.review" + " FROM movie AS M";
result = stmt.executeQuery(query);

Can anyone help me correct this.
[875 byte] By [trixma] at [2007-11-11 6:54:29]
# 1 Re: URL Rewritting
The select statement you use here will retrieve all records in the movie table,
it has no where clause, I assume that the passed reviewID shall go into that clause.
sjalle at 2007-11-11 22:39:56 >